mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENH: Add extension hooks to core emails
This commit is contained in:
parent
6c3edb2b52
commit
903dd860b7
@ -914,7 +914,7 @@ class Member extends DataObject
|
||||
&& static::config()->get('notify_password_change')
|
||||
&& $this->isInDB()
|
||||
) {
|
||||
Email::create()
|
||||
$email = Email::create()
|
||||
->setHTMLTemplate('SilverStripe\\Control\\Email\\ChangePasswordEmail')
|
||||
->setData($this)
|
||||
->setTo($this->Email)
|
||||
@ -922,8 +922,10 @@ class Member extends DataObject
|
||||
__CLASS__ . '.SUBJECTPASSWORDCHANGED',
|
||||
"Your password has been changed",
|
||||
'Email subject'
|
||||
))
|
||||
->send();
|
||||
));
|
||||
|
||||
$this->extend('updateChangedPasswordEmail', $email);
|
||||
$email->send();
|
||||
}
|
||||
|
||||
// The test on $this->ID is used for when records are initially created. Note that this only works with
|
||||
|
@ -242,6 +242,8 @@ class LostPasswordHandler extends RequestHandler
|
||||
))
|
||||
->addData('PasswordResetLink', Security::getPasswordResetLink($member, $token))
|
||||
->setTo($member->Email);
|
||||
|
||||
$member->extend('updateForgotPasswordEmail', $email);
|
||||
return $email->send();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user