跳到主要内容

Email Provider

Strapi Cloud comes with a basic email provider out of the box. However, it can also be configured to utilize another email provider, if needed.

Caution

Please be advised that Strapi are unable to provide support for third-party email providers.

Prerequisites
  • A local Strapi project running on v4.8.2+.
  • Credentials for another email provider (see Strapi Market).

Configuration

Configuring another email provider for use with Strapi Cloud requires 3 steps:

  1. Install the provider plugin in your local Strapi project.
  2. Configure the provider in your local Strapi project.
  3. Add environment variables to the Strapi Cloud project.

Install the Provider Plugin

Using either npm or yarn, install the provider plugin in your local Strapi project as a package dependency by following the instructions in the respective entry for that provider in the Marketplace.

Configure the Provider

Caution

The file structure must match the below path exactly, or the configuration will not be applied to Strapi Cloud.

To configure a 3rd-party email provider in your Strapi project, create or edit the plugins configuration file for your production environment ./config/env/production/plugins.js|ts by adding upload configuration options as follows:


module.exports = ({ env }) => ({
// … some unrelated plugins configuration options
email: {
config: {
// … provider-specific upload configuration options go here
}
// … some other unrelated plugins configuration options
}
});

Each provider will have different configuration settings available. Review the respective entry for that provider in the Marketplace.

Example:

module.exports = ({ env }) => ({
// ...
email: {
config: {
provider: 'sendgrid',
providerOptions: {
apiKey: env('SENDGRID_API_KEY'),
},
settings: {
defaultFrom: 'myemail@protonmail.com',
defaultReplyTo: 'myemail@protonmail.com',
},
},
},
// ...
});
Tip

Before pushing the above changes to GitHub, add environment variables to the Strapi Cloud project to prevent triggering a rebuild and new deployment of the project before the changes are complete.

Strapi Cloud Configuration

  1. Log into Strapi Cloud and click on the corresponding project on the Projects page.
  2. Click on the Settings tab and choose Variables in the left menu.
  3. Add the required environment variables specific to the email provider.
  4. Click Save.

Example:

VariableValue
SENDGRID_API_KEYyour_sendgrid_api_key

Deployment

To deploy the project and utilize another party email provider, push the changes from earlier. This will trigger a rebuild and new deployment of the Strapi Cloud project.

Once the application finishes building, the project will use the new email provider.

Custom Provider

If you want to create a custom email provider, please refer to the Providers documentation in the Developer Documentation.