Mailtrap provider for Strapi CMS
Using npm: npm install strapi-provider-email-mailtrap --save
Using yarn: yarn add strapi-provider-email-mailtrap
- You need a Mailtrap account: https://mailtrap.io
- From the inbox page get your
username
andpassword
.
Instruct the email plugin to use the mailtrap provider.
module.exports = ({ env }) => ({
// ...
email: {
provider: 'mailtrap',
providerOptions: {
user: env('MAILTRAP_USER', 'default_user'),
password: env('MAILTRAP_PASSWORD', 'default_pass')
},
settings: {
defaultFrom: env('MAILTRAP_DEFAULT_FROM', '[email protected]'),
defaultReplyTo: env('MAILTRAP_DEFAULT_REPLY_TO', '[email protected]'),
},
}
// ...
});
If you want to use it in every environment, you should add the above code to config/plugins.js
.
If you want to use it in a certain environment, you should add the above code to config/env/plugins.js
.