django-allauth HTML 电子邮件不发送

标签 django django-allauth

我在我的模板文件夹中添加了以下子文件夹和文件以覆盖电子邮件(遵循文档 https://github.com/pennersr/django-allauth#sending-e-mail)a:

templates/
   account/
     email/
       email_confirmation_message.html
       email_confirmation_message.txt
       email_confirmation_subject.txt

覆盖适用于 *.txt 版本的电子邮件(意思是,我认为,我有一个正确的文件夹结构)但我的问题是 django_allauth 没有发送 HTML 版本。

最佳答案

对于那些面临同样问题的人:

当涉及到电子邮件确认时 django_allauth 检查它是否是新用户并相应地查找模板:

所以你必须覆盖:

email_confirmation_message.txt
email_confirmation_signup_message.txt

并添加 HTML 版本
email_confirmation_message.html
email_confirmation_signup_message.html

关于django-allauth HTML 电子邮件不发送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17383098/

相关文章:

django - 浏览器阻止跨域 iframe cookie

python - Django框架安装

python - 如何修改 django-rest-framework API

django 表单在 init 上而不是在元类中排除字段

django - Django 1.7.1 的迁移错误

python - django-rest-auth:密码重置功能问题

python - 文件未找到错误: [Errno 2] No such file or directory: 'test_user1_user_id'

javascript - Google Maps API 的哪些组件用于生成绘制许多地址的 map ?

django-allauth 和 twitter 集成 - 社交网络登录失败

django - 检索访问 token : b'{\n "error": "redirect_uri_mismatch", 时出错\n "error_description": "Bad Request"\n}'