Django
Send Cocoonmail emails over SMTP.
Send transactional emails from your Django project using Cocoonmail’ SMTP service.
As Cocoonmail’ SMTP service requires sending an API-like email body rather than a full email, it’s not recommended to use Cocoonmail as the default SMTP service for your app in your settings file.
Instead, use a custom connection
for each email request that you want to send through Cocoonmail.
Sending email from Django with Cocoonmail’ SMTP service is easy but there’s one gotcha: the email body needs to be an API-like payload.
This may seem strange at first but it allows you to use Cocoonmail’ WYSIWYG editor to craft your emails and keep email templating outside of your code repo.
We are using a custom connection
for sending this email as typically only some emails in a project will be sent through Cocoonmail.
The connection’s password
value should be an API key from your API Settings page.
transactionalId
value in the email payload.