I use two approaches for sending email:
- Use django.core.mail.send_mail() and send the email template along with the parameters.
- Use django.core.mail.EmailMessage() and django.core.mail.get_connection().send_messages() to use an email template in my ESP account.
I have been using Mandrill up until now, and want to switch to SparkPost. I have configured and published templates in both my Mandrill and SparkPost accounts, and my API keys for both services. The slug for a given template on Mandrill is the same as both the name and ID of the equivalent template on SparkPost. I used SparkPost's migration tool so this should be correct.
When I switch the email backend from anymail.backends.mandrill.MandrillBackend to anymail.backends.sparkpost.SparkPostBackend, the emails sent via send_mail() come through fine, but the emails using the templates, sent via send_messages(), arrive with an empty message body, i.e. there is no email. I can send the templates as test emails with dummy data via the SparkPost dashboard just fine.
I use two approaches for sending email:
I have been using Mandrill up until now, and want to switch to SparkPost. I have configured and published templates in both my Mandrill and SparkPost accounts, and my API keys for both services. The slug for a given template on Mandrill is the same as both the name and ID of the equivalent template on SparkPost. I used SparkPost's migration tool so this should be correct.
When I switch the email backend from anymail.backends.mandrill.MandrillBackend to anymail.backends.sparkpost.SparkPostBackend, the emails sent via send_mail() come through fine, but the emails using the templates, sent via send_messages(), arrive with an empty message body, i.e. there is no email. I can send the templates as test emails with dummy data via the SparkPost dashboard just fine.