Back to Strapi

@strapi/provider-email-sendgrid

packages/providers/email-sendgrid/README.md

5.45.02.5 KB
Original Source

@strapi/provider-email-sendgrid

Resources

Installation

bash
# using yarn
yarn add @strapi/provider-email-sendgrid

# using npm
npm install @strapi/provider-email-sendgrid --save

Configuration

VariableTypeDescriptionRequiredDefault
providerstringThe name of the provider you useyes
providerOptionsobjectProvider optionsyes
providerOptions.apiKeyobjectApi key given to the function setApiKey. Please refer to @sendgrid/mailyes
settingsobjectSettingsno{}
settings.defaultFromstringDefault sender mail addressnoundefined
settings.defaultReplyTostring | array<string>Default address or addresses the receiver is asked to reply tonoundefined

: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

Example

Path - config/plugins.js

js
module.exports = ({ env }) => ({
  // ...
  email: {
    config: {
      provider: 'sendgrid',
      providerOptions: {
        apiKey: env('SENDGRID_API_KEY'),
      },
      settings: {
        defaultFrom: '[email protected]',
        defaultReplyTo: '[email protected]',
      },
    },
  },
  // ...
});