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
:
1module.exports = ({ env }) => ({
2 // ...
3 email: {
4 config: {
5 provider: 'strapi-provider-email-azure',
6 providerOptions: {
7 endpoint: env('AZURE_ENDPOINT'),
8 },
9 settings: {
10 defaultFrom: env('FALLBACK_EMAIL'),
11 },
12 },
13 },
14 // ...
15});
1await strapi
2 .plugin('email')
3 .service('email')
4 .send({
5 from: process.env.EMAIL_SERVICE_ADDRESS,
6 to: [
7 {
8 address: 'recipent@email.address',
9 displayName: 'Display Name',
10 },
11 ],
12 subject: 'Hello world',
13 text: 'Hello world',
14 });
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>) |
1type EmailAddress {
2 address: string,
3 displayName: string
4}
5type Attachment {
6 name: string,
7 contentType: string,
8 contentInBase64: string
9}
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.