Mailing Subscribers

Posted: 01/27/2020

Mailer is an application I integrated into BlogCMS. It emails your subscribers about your most recent post. Any one can subscribe with the form on the front page. To see these subscribers:

Forms > Subscribers

You could email these people manually but what would be the fun in that? The mailer application requires a Simple Mail Transfer Protocol provider. In simple terms you can use this provider to send emails automatically. At the time of writing this post sendgrid is offering a free SMTP tier. You will need to get 3 things from this provider (hostname, username, password).

You will need to input this information into Netlify so it can send emails. Go to:

Settings > Build & Deploy > Environment > Edit Variables

The variable names but be exact so fill out like so:

SMTP_HOST: smtp.host.com
SMTP_USER: yourusername
SMTP_PASS: yourpassword

You will now need to create a Netlify token so the mailer application can read the list of subscribers.

https://app.netlify.com/user/applications#personal-access-tokens

New Access Token > [Description: mailer] > Generate Token > [Save Token]

Make sure you save this token because it will not show again. We will need to configure the last variables for Netlify. Mailer token is different from Netlify token and enables you to send the email via the mailer application. Make sure you remember this.

NETLIFY_TOKEN: faopwavpna
MAILER_TOKEN: yourememberthis
YOUR_EMAIL: [email protected]

Once that is done you are ready to go to the mailer application (/mailer) and send away!