2021-12-01 07:59:34 -07:00
# @strapi/provider-email-sendgrid
2018-05-31 14:29:00 -05:00
## Resources
2021-12-01 09:00:24 -07: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/ )
2021-12-01 07:59:34 -07:00
- [Strapi documentation ](https://docs.strapi.io )
- [Strapi community on Discord ](https://discord.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
## Installation
```bash
# using yarn
2021-12-01 07:59:34 -07:00
yarn add @strapi/provider -email-sendgrid
2020-05-14 16:55:08 +02:00
# using npm
2021-12-01 07:59:34 -07:00
npm install @strapi/provider -email-sendgrid --save
2020-05-14 16:55:08 +02:00
```
## 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: {
2021-11-30 10:33:42 -07:00
config: {
provider: 'sendgrid',
providerOptions: {
apiKey: env('SENDGRID_API_KEY'),
},
settings: {
defaultFrom: 'myemail@protonmail .com',
defaultReplyTo: 'myemail@protonmail .com',
},
2020-05-14 18:11:24 +02:00
},
2020-05-14 16:55:08 +02:00
},
// ...
});
```