Skip to content

Implementing a new email backend

Sven Steinheißer edited this page Feb 22, 2017 · 1 revision

Yelp Love uses a modular architecture that allows emails to be sent using several different services. Two which are currently implemented are the Google App Engine email API, as well as the SendGrid API. You may add more email backends with the following steps:

  1. In logic/email.py, implement a function which takes the arguments sender, recipient, subject, body_html, body_text, and sends an email. See for example send_appengine_email() and send_sendgrid_email().
  2. Update the logic.email.EMAIL_BACKENDS dict to map the name of your backend to the function you have implemented.
  3. Set EMAIL_BACKEND appropriately in your config.py.
  4. Be sure to document any additional parameters (such as API tokens) and give a brief description of how to use your email backend in the wiki.
Clone this wiki locally