Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2375 closed enhancement (fixed)

[patch] Let email template be variable for password reset

Reported by: treborhudson@… Owned by: adrian
Component: Contrib apps Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Similar to the other fairly recent changes where you can pass in a different template name for login, logout, password_change[_done], password_reset[_done] in urls.py, the email template should also have the ability to be overridden. For example, in my case, I'm putting all login related stuff in the accounts template directory. Without this functionality you always need a registration template directory.

I've got a proposed diff that is tested and is working on a site I'm developing. I'll submit it after posting this. I'm not sure of the correct way to submit a patch so I'm using "svn diff > email_template.patch".

What this will do is allow one to override the email template you set it in your urls.py like so:

(r'accounts/password_reset/$', 'django.contrib.auth.views.password_reset', {'template_name': 'accounts/pwreset.html', 'email_template_name': 'accounts/pwreset_email.txt'}),

Note the new key "email_template_name" is new.

Attachments (2)

email_template.patch (2.2 KB) - added by treborhudson@… 8 years ago.
email_template.2.patch (2.3 KB) - added by treborhudson@… 8 years ago.
The first patch forgot the default email template in save() function

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by treborhudson@…

Changed 8 years ago by treborhudson@…

The first patch forgot the default email template in save() function

comment:1 Changed 8 years ago by anonymous

  • Summary changed from Let email template be variable for password reset to [patch] Let email template be variable for password reset

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [3462]) Fixed #2375 -- Changed password_reset auth view to make e-mail template name variable. Thanks, treborhudson@…

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.