问题
I'm using allauth
version 0.35.0
and I want to override email templates to make my desired HTML template for them. No problem with allauth
login and SignUp and etc. pages But I can't find any template for emails.
It's just a .txt
file in path /templates/account/email/
. But How can I set HTML
message for allauth
tasks like changing password and etc. for their email messages?
Any help will be appreciated.
回答1:
Ooops! Shame on me!
in this part of allauth documentation This said that:
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
So making email_confirmation_message.html
in my own template and using template variables which are used in the email_confirmation_message.txt
solved the problem.
来源:https://stackoverflow.com/questions/51684839/how-to-override-django-allauth-email-templates