1.1.0 • Published 5 years ago
strapi-provider-email-nodemailer-refactor v1.1.0
strapi-provider-email-nodemailer-refactor
Prerequisites
You need to have the plugin strapi-plugin-email
installed in you Strapi project.
Installation
# using yarn
yarn add strapi-provider-email-nodemailer-refactor
# using npm
npm install strapi-provider-email-nodemailer-refactor --save
Configuration
Variable | Type | Description | Required | Default |
---|---|---|---|---|
provider | string | The name of the provider you use | yes | |
providerOptions | object | Will be given to nodemailer.createTransport() . | yes | {} |
providerOptions.host | string | Is the hostname or IP address to connect to | yes | undefined |
providerOptions.port | string | number | Is the port to connect to (defaults to 587 if is secure is false or 465 if true) | yes | undefined |
providerOptions.secure | boolean | If true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false | yes | undefined |
providerOptions.username | string | Is the username of your SMTP server | yes | undefined |
providerOptions.password | string | Is the password of your SMTP server | yes | undefined |
settings | object | Default Settings | no | {} |
settings.defaultFrom | string | Default sender mail address | no | undefined |
settings.defaultReplyTo | string | Default address the receiver is asked to reply to | no | undefined |
See the using a provider documentation for information on installing and using a provider. And see the environment variables for setting and using environment variables in your configs.
Example
./config/plugins.js
module.exports = ({ env }) => ({
// ...
email: {
provider: 'nodemailer-refactor',
providerOptions: {
host: env('SMTP_HOST'),
port: env('SMTP_PORT'),
secure: env('SMTP_SECURE'),
username: env('SMTP_USERNAME'),
password: env('SMTP_PASSWORD'),
},
settings: {
defaultFrom: 'azeazeaze@strapi.io',
defaultReplyTo: 'azezaeaze@strapi.io',
},
},
// ...
});