Manage Multiple Email Services with Django
Use different platforms according to your needs
As we have learned in my previous post, there are a lot of benefits in concentrating all the code related with sending emails in one place, creating a base mailer which handles the creation and delivery of messages, and subclassing it to manage some configurations that vary from email to email. We also learned a way to pass domain data to the email service to fill the email content with it.
In this article we will use what we achieved before to create a more complex email module, having different mailers and services for possible different situations. Let’s go!
Creating a mailer
In my other post we created a base mailer and some subclasses of it to send different emails using SendGrid. I will leave the code below to have it in mind.