Azure Email Communcation Service provider for Strapi
# using yarn
yarn add strapi-provider-email-azure
# using npm
npm install strapi-provider-email-azure --save
Then in your config/plugins.js
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module.exports = ({ env }) => ({
// ...
email: {
config: {
provider: 'strapi-provider-email-azure',
providerOptions: {
endpoint: env('AZURE_ENDPOINT'),
},
settings: {
defaultFrom: env('FALLBACK_EMAIL'),
},
},
},
// ...
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
await strapi
.plugin('email')
.service('email')
.send({
from: process.env.EMAIL_SERVICE_ADDRESS,
to: [
{
address: 'recipent@email.address',
displayName: 'Display Name',
},
],
subject: 'Hello world',
text: 'Hello world',
});
You can also leave the from
field empty to send the email from the fallback address.
The following fields are supported:
Field | Description |
---|---|
from | Email address of the sender (string) |
to | Array of recipients (string | EmailAddress | Array\ |
cc | Array of recipients who get cc (string | EmailAddress | Array\ |
bcc | Array of recipients who get bcc (string | EmailAddress | Array\ |
replyTo | Email address to which replies are sent (Array\ |
subject | Subject of the email (string) |
text | Plaintext version of the message (string) |
html | HTML version of the message (string) |
attachments | Array of attachments (Array\ |
disableUserEngagementTracking | Whether user engagement tracking should be disabled (boolean) |
headers | Custom email headers (Dictionary<string, string>) |
1
2
3
4
5
6
7
8
9
type EmailAddress {
address: string,
displayName: string
}
type Attachment {
name: string,
contentType: string,
contentInBase64: string
}
For more information, please refer to @azure/communication-email documentations:
AZURE_ENDPOINT=<connection_string>
strapi-provider-email-azure
in your environment variables\
FALLBACK_EMAIL=DoNotReply@yourdomain
npm install strapi-provider-email-azure
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.