Reputation: 483
I was able to customize the confirmation email HTML template by adding this file into the templates folder:
templates/account/email/email_confirmation_signup_message.html
Now I'm trying to customize the subject of the email by adding the text I want inside this file:
templates/account/email/email_confirmation_signup_subject.txt
But it doesn't seem to do anything, I still get the default subject all the time.
Does anyone know what I'm doing wrong?
Many thanks!
Upvotes: 3
Views: 2921
Reputation: 437
api_project/templates/account/email/email_confirmation_subject.txt
!templates/account/email/email_confirmation_subject.txt
a variable that you need to configure and it's not quit obvious it's ACCOUNT_EMAIL_SUBJECT_PREFIX = '[example.com]'
Upvotes: 3
Reputation: 33
You have to add this two files... first: account/email/email_confirmation_signup_message.html
{% include "account/email/email_confirmation_message.html" %}
second:
account/email/email_confirmation_message.html
The template that you want.
and finally delete the two .txt file: account/email/email_confirmation_signup_message.txt account/email/email_confirmation_message.txt
pd: if you copy the folder template/account from your virtual enviroment you have to delete the files over there as well.
Upvotes: 2
Reputation: 1
Maybe the problem comes with your urls.py file You need to indicate here the file you use to customize the subject of your email.
PasswordResetView.as_view(template_name='email_confirmation_signup_message.html', subject_template_name='email_confirmation_signup_subject.txt')
Upvotes: 0
Reputation: 140
Change file name to this:-
templates/account/email/email_confirmation_subject.txt
and inside write
{% load i18n %}
{% autoescape off %}
{% blocktrans %}Please Confirm Your E-mail Address or do whatever..{% endblocktrans %}
{% endautoescape %}
Upvotes: 1
Reputation: 1093
Do in this way...
install django-mail-templated
base template file code...
{{ TAG_START_SUBJECT }}
{% autoescape off %}
{% block subject %}
{% endblock %}
{% endautoescape %}
{{ TAG_END_SUBJECT }}
{% block subject %}
Hello User..
{% endblock %}
Upvotes: 0