Setup

For emails, we’re using Mailjet. They provide an extremely generous free tier so you won’t have to pay a dime for your MVP.

1

Register

Head over to Mailjet and create an account (choose the free plan).

2

Get API Keys

Navigate to the API page and generate a secret key. Paste the API Key and Secret Key in your .env file.

.env
MAILJET_API_KEY=[API KEY]
MAILJET_SECRET_KEY=[SECRET KEY]

Usage

You can use Mailjet to send emails programatically throughout your app. There is a usage demo in that you can reference in src/routes/api/mailjet. Click here to view the docs.

Avoid the spam folder

To avoid having your emails go into spam, you will need authenticate your domain.

You must have custom domain to do this.

1

Add domain or sender address

Navigate to Mailjet and add a domain or sender address. Follow the steps to validate.

2

SPF/DKIM Setup

Go to the SPF/DKIM Authentication section, hit the cogwheel next to your domain and then click setup.

3

Add Records

Your email service provider will have an admin panel where you can create and edit the SPF and DKIM records. Generally, you will need to create a new DKIM and edit the old SPF to include include:spf.mailjet.com.

Use subdomains for bulk email campaigns to uphold your domain reputation and avoid the spam folder.