David542
David542

Reputation: 110163

django-registration Email Customizations

I am using django-registration, and have two questions with regards to customizing the email sent after a user has requested to reset his password.

This is what I currently have in password_reset_email.html:

{% load i18n %}
{% blocktrans %} Please click the link below to change your password:
{% endblocktrans %}

{% block reset_link %}{{ domain }}{% url auth_password_reset_confirm uidb36=uid, token=token %}

Thanks,
Mysite
{% endblock %}

And in my settings.py:

DEFAULT_FROM_EMAIL = 'Mysite'

I have two questions --

1) Currently the email is from Mysite, with return address 'Mysite'. How do I make it so it appears as Mysite, but the return address is '[email protected]'?

2) Currently the subject of the email says 'Password reset on Mysite'How/where do I change the subject of the reset-password email?

Upvotes: 0

Views: 877

Answers (2)

Avid Coder
Avid Coder

Reputation: 18387

You can change the subject of the email in your <...>templates/registration/activation_email_subject.txt

Make sure that file exists, then put in it whatever you want.

Also, your email should be "[email protected]" instead of [email protected].

Upvotes: 1

Abid A
Abid A

Reputation: 7858

1) You should change your email setting to DEFAULT_FROM_EMAIL = 'Mysite <[email protected]>'

2) The last I checked, this was not changeable. django-registration has the subject line hardcoded.

EDIT: Correction: The password reset subject line is set by Django's PasswordResetFormnot django-registration.

Upvotes: 2

Related Questions