DEV Community

Cover image for How to setup AWS SES email provider in your Strapi app
kevinadhiguna
kevinadhiguna

Posted on

3 4

How to setup AWS SES email provider in your Strapi app

When you forgot password and want to reset it, you usually get an email that contains a link to your application. Then it will redirect you to a page where you can create a new password. An operation like this requires an email provider, such as AWS Simple Email Service (SES).

In this article, we will learn how to setup AWS SES email provider in your Strapi app.

Prerequisites :

Step 1 : Install Strapi AWS SES email provider
Open your terminal, then run :
yarn add strapi-provider-email-amazon-ses
or
npm i strapi-provider-email-amazon-ses --save

Check your package.json if strapi-provider-email-amazon-ses exists. If so, you have successfully installed Strapi AWS SES email provider.

Step 2 : Create plugins.js in config directory
PATH : ./config/plugins.js

module.exports = ({ env }) => ({
 email: {
   provider: 'amazon-ses',
   providerOptions: {
     key: env('AWS_ACCESS_KEY_ID'),
     secret: env('AWS_SECRET_ACCESS_KEY'),
     amazon: `https://email.${env('AWS_REGION')}.amazonaws.com`
   },
   settings: {
     defaultFrom: env('EMAIL_DEFAULT_FROM'),
     defaultReplyTo: env('EMAIL_DEFAULT_REPLY_TO')
   }
 },
}
Enter fullscreen mode Exit fullscreen mode

Configuration
Alt Text

Step 3 : Fill in environment variables
In ./config/plugins.js above, we assigned a lot of environment variables. Now it’s time to fill them in.
PATH : .env (root directory of your Strapi app)
Alt Text

It is not mandatory to include defaultFrom (EMAIL_DEFAULT_FROM) and defaultReplyTo (EMAIL_DEFAULT_REPLYTO) in environment variables but optional.

How do I gain my AWS security credentials ?
Simply sign in to the AWS management console, then open the dropdown menu. Select My Security Credentials.
Alt Text

After that you will see a page like this :
Alt Text

Learn more how to gain your AWS security credentials.

Hooray! It’s time to start your Strapi app and make sure it works. Thanks for reading, hope you have a great day today!

Connect with me :
LinkedIn - kevinadhiguna
Github - kevinadhiguna

References :

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more