gpt4 book ai didi

django-templates - 如何覆盖 django allauth 电子邮件模板

转载 作者:行者123 更新时间:2023-12-01 09:44:45 26 4
gpt4 key购买 nike

我正在使用 allauth版本0.35.0我想覆盖电子邮件模板来为它们制作我想要的 HTML 模板。 allauth没问题登录和注册等页面但我找不到任何电子邮件模板。

这只是一个 .txt路径中的文件 /templates/account/email/ .但是我该如何设置 HTML留言给 allauth像更改他们的电子邮件的密码等任务?

任何帮助将不胜感激。

最佳答案

哎呀!耻辱我!
this part of allauth documentation这说:

Emails sent (e.g. in case of password forgotten or email confirmation) can be altered by providing your own templates. Templates are named as follows:

account/email/email_confirmation_subject.txt

account/email/email_confirmation_message.txt

In case you want to include an HTML representation, add an HTML template as follows:

account/email/email_confirmation_message.html


所以制作 email_confirmation_message.html在我自己的模板中并使用在 email_confirmation_message.txt 中使用的模板变量解决了这个问题。

关于django-templates - 如何覆盖 django allauth 电子邮件模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51684839/

26 4 0