⬅️ Back to USKPA Documentation
The USKPA website relies on email for account registration and notifications to users.
Heroku add-ons and the django-anymail package are leveraged to provide this functionality in production and staging environments.
We default to using the SendGrid Add-on and its free starter tier of service.
The starter tier provides up to 12,000 emails per month, ~394/day. This is expected to provide ample volume for both development and a production instance during normal operation.
A few one-time steps are required to set-up email functionality on a newly deployed Heroku instance.
Prerequisite: Heroku requires account verification prior to add-on installation. A payment method must be added to the account associated with the Heroku instance being deployed.
-
Add the SendGrid starter tier add-on
- This can be done via the Heroku dashboard
- Or the command line:
$ heroku addons:create sendgrid:starter
-
Follow the Heroku instructions to create and set a
SENDGRID_API_KEY
value in the deployed application. -
Set additional environment variables via the Heroku CLI or Dashboard:
DJANGO_EMAIL_BACKEND=anymail.backends.sendgrid.EmailBackend DJANGO_FROM_EMAIL= DJANGO_EMAIL_SUBJECT_PREFIX=
DJANGO_FROM_EMAIL
- Defaults toCONTACT_US
value as configured in environment. Will be the address which recipients see on theFROM
line of incoming emails. It should be set to a monitored inbox unless reply instructions are included within the message.DJANGO_EMAIL_SUBJECT_PREFIX
helps differentiate deployed instances when the system generates emails to site administrators and should be set to the name of the Heroku instance.
Mail volume in excess of 12,000 emails a month is not anticipated.
Should the need arise
- The SendGrid add-on can be upgraded to a paid tier providing additional volume.
- Another email add-on can be selected and configured.