21282 Posts in 5730 Topics by 2601 members
General Questions
SilverStripe Forums » General Questions » How to change the 'Subject' of the default passwordreset email template?
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 327 Views |
-
How to change the 'Subject' of the default passwordreset email template?

14 March 2012 at 2:37am
Hi,
Is that possible to change the 'Subject' of the default passwordreset email template without touching the original code?
I found the code reside in Sapphire/Security/Member.php as show below:
/**
* Class used as template to send the forgot password email
* @package sapphire
* @subpackage security
*/
class Member_ForgotPasswordEmail extends Email {
protected $from = ''; // setting a blank from address uses the site's default administrator email
protected $subject = '';
protected $ss_template = 'ForgotPasswordEmail';function __construct() {
parent::__construct();
$this->subject = _t('Member.SUBJECTPASSWORDRESET', "Your password reset link", PR_MEDIUM, 'Email subject');
}
} -
Re: How to change the 'Subject' of the default passwordreset email template?

14 March 2012 at 10:05pm
You can create your own custom Member_ForgotPasswordEmail and tell to use your class.
..
class MyMember_ForgotPasswordEmail extends Member_ForgotPasswordEmail {
function __construct() {
parent::__construct();$this->subject = "Hi!";
}
}
..In your _config.php
Object::useCustomClass('Member_ForgotPasswordEmail', 'MyMember_ForgotPasswordEmail');
-
Re: How to change the 'Subject' of the default passwordreset email template?

15 March 2012 at 2:30am
Hi Willr,
It works perfectly fine, thanks!
| 327 Views | ||
|
Page:
1
|
Go to Top |


