2020-05-14 16:55:08 +02:00
# strapi-provider-email-sendgrid
2018-05-31 14:29:00 -05:00
## Resources
2020-07-20 18:07:48 +02:00
- [License ](LICENSE )
2018-05-31 14:29:00 -05:00
## Links
2021-01-26 17:06:25 +01:00
- [Strapi website ](https://strapi.io/ )
- [Strapi community on Slack ](https://slack.strapi.io )
2018-05-31 14:29:00 -05:00
- [Strapi news on Twitter ](https://twitter.com/strapijs )
2020-05-14 16:55:08 +02:00
## Prerequisites
You need to have the plugin `strapi-plugin-email` installed in you Strapi project.
## Installation
```bash
# using yarn
yarn add strapi-provider-email-sendgrid
# using npm
npm install strapi-provider-email-sendgrid --save
```
## Configuration
2020-05-15 15:05:35 +02:00
| Variable | Type | Description | Required | Default |
| ----------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------- | -------- | --------- |
| provider | string | The name of the provider you use | yes | |
| providerOptions | object | Provider options | yes | |
| providerOptions.apiKey | object | Api key given to the function setApiKey. Please refer to [@sendgrid/mail ](https://www.npmjs.com/package/@sendgrid/mail ) | yes | |
| settings | object | Settings | no | {} |
| settings.defaultFrom | string | Default sender mail address | no | undefined |
| settings.defaultReplyTo | string \| array< string > | Default address or addresses the receiver is asked to reply to | no | undefined |
2020-05-14 16:55:08 +02:00
2021-04-20 05:57:52 -07:00
> :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
2021-04-29 11:11:46 +02:00
2020-05-14 16:55:08 +02:00
### Example
**Path -** `config/plugins.js`
```js
module.exports = ({ env }) => ({
// ...
email: {
2020-05-14 18:11:24 +02:00
provider: 'sendgrid',
providerOptions: {
apiKey: env('SENDGRID_API_KEY'),
2020-05-15 15:05:35 +02:00
},
settings: {
2020-05-14 18:11:24 +02:00
defaultFrom: 'myemail@protonmail .com',
defaultReplyTo: 'myemail@protonmail .com',
},
2020-05-14 16:55:08 +02:00
},
// ...
});
```