Configuration
Emails
Choose between Postmark, SendGrid, or Resend
Implementation
The main logic can be found in the service-go-user/domain/email/provider.go
file.
The local provider is a mock implementation that doesn’t require any configuration. It logs the email content to the console.
Configuration
This choice can be made using the GoFast CLI or by modifying the docker-compose.yml
file.
via CLI
Possible options are Postmark
, SendGrid
, Resend
, AWS SES
and Local (log)
via Docker Compose
Possible options are postmark
, sendgrid
, resend
, ses
and local
.
Emails Configuration
Depending on the provider, you need to set the following environment variables in the docker-compose.yml
file:
- for
postmark
, setPOSTMARK_API_KEY
. - for
sendgrid
, setSENDGRID_API_KEY
. - for
resend
, setRESEND_API_KEY
. - for
ses
, setSES_ACCESS_KEY
,SES_SECRET_KEY
, andSES_REGION
. - for
local
, no configuration is needed.
Getting Secrets
Postmark
- Go to the Postmark website.
- Create an account or log in.
- Go to the Servers page.
- Click on the server you want to use.
- Go the
API Tokens
tab. - Copy the token and set it as the
POSTMARK_API_KEY
in thedocker-compose.yml
file.
Sendgrid
- Go to the SendGrid website.
- Create an account or log in.
- Go to the API Keys page.
- Click on the
Create API Key
button. - Copy the key and set it as the
SENDGRID_API_KEY
in thedocker-compose.yml
file.
Resend
- Go to the Resend website.
- Create an account or log in.
- Go to the API Keys page.
- Click on the
Create API Key
button. - Copy the key and set it as the
RESEND_API_KEY
in thedocker-compose.yml
file.
AWS SES
- Go to the AWS website.
- Create an account or log in.
- Go to the IAM page.
- Click on the
Users
tab. - Click on the
Add user
button. - Fill in the user details and click on the
Next: Permissions
button. - Click on the
Attach existing policies directly
button. - Search for
AmazonSESFullAccess
and select it. - Click on the
Next: Tags
button. - Click on the
Next: Review
button. - Click on the
Create user
button. - Copy the
Access key ID
andSecret access key
and set them as theSES_ACCESS_KEY
andSES_SECRET_KEY
in thedocker-compose.yml
file. - Go to the SES page.
- Click on the
Email addresses
tab. - Click on the
Verify a New Email Address
button. - Enter the email address you want to verify and click on the
Verify This Email Address
button. - Go to the SES page.
- Click on the
Regions
tab. - Copy the region and set it as the
SES_REGION
in thedocker-compose.yml
file. - Cry for using AWS.
Need help?
Visit our discord server to ask any questions, make suggestions and give feedback :).
Was this page helpful?