0
我已将sendgrid-django集成到我的项目中,并且电子邮件工作正常,一切都很好。 据Sendgrid文件,如果我想测试电子邮件,而无需实际发送它,我应该做这样的事情:sendgrid-django发送带有sandbox_mode的邮件
"mail_settings": {
"sandbox_mode": {
"enable": True
}
}
因此,使用sendgrid-的Django我创建的电子邮件的对象,离开了“体”的说法空白,以使用sendgrid模板,添加sendgrid template_id,替换,然后mail_settings:
mail = EmailMessage(
'Subject of my email',
' ',
'[email protected]',
[[email protected]],
reply_to=[[email protected]],
)
mail.template_id = 'template_id'
mail.substitutions = {
'-first_name-': 'Ace',
'-last_name-': 'Ventura'
}
mail.mail_settings = {
"sandbox_mode": {
"enable": True
}
}
我的电子邮件是在任何情况下被发送,所以这个问题是...我怎样才能添加这些mail_settings
,并让他们的工作? ?