@palmabit/strapi-provider-email-mandrill
v0.1.0
Published
Mandrill provider for Strapi 4
Downloads
4
Readme
@palmabit/strapi-provider-email-mandrill
Links
Installation
# using yarn
yarn add @palmabit/strapi-provider-email-mandrill
# using npm
npm install @palmabit/strapi-provider-email-mandrill --save
Example
Path - config/plugins.js
module.exports = ({ env }) => ({
// ...
email: {
config: {
provider: '@palmabit/strapi-provider-email-mandrill',
providerOptions: {
auth: {
apiKey: env('MANDRILL_KEY', ''),
},
// ... any custom options
},
settings: {
defaultFrom: '[email protected]',
defaultReplyTo: '[email protected]',
},
},
},
// ...
});
Development mode
You can override the default configurations for specific environments. E.g. for
NODE_ENV=development
in config/env/development/plugins.js:
Usage
:warning: The Shipper Email (or defaultfrom) may also need to be changed in the
Email Templates
tab on the admin panel for emails to send properly
To send an email from anywhere inside Strapi:
await strapi
.plugin('email')
.service('email')
.send({
to: '[email protected]',
from: '[email protected]',
subject: 'Hello world',
text: 'Hello world',
html: `<h4>Hello world</h4>`,
});
The following fields are supported:
| Field | Description | | ----------- | ----------------------------------------------------------------- | | from | Email address of the sender | | to | Comma separated list or an array of recipients | | replyTo | Email address to which replies are sent | | cc | Comma separated list or an array of recipients | | bcc | Comma separated list or an array of recipients | | subject | Subject of the email | | text | Plaintext version of the message | | html | HTML version of the message | | attachments | Array of objects See: https://nodemailer.com/message/attachments/ |