mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #10319 from kinglozzer/email-hooks
ENH: Add extension hooks to core emails
This commit is contained in:
commit
981f63678e
@ -914,7 +914,7 @@ class Member extends DataObject
|
|||||||
&& static::config()->get('notify_password_change')
|
&& static::config()->get('notify_password_change')
|
||||||
&& $this->isInDB()
|
&& $this->isInDB()
|
||||||
) {
|
) {
|
||||||
Email::create()
|
$email = Email::create()
|
||||||
->setHTMLTemplate('SilverStripe\\Control\\Email\\ChangePasswordEmail')
|
->setHTMLTemplate('SilverStripe\\Control\\Email\\ChangePasswordEmail')
|
||||||
->setData($this)
|
->setData($this)
|
||||||
->setTo($this->Email)
|
->setTo($this->Email)
|
||||||
@ -922,8 +922,10 @@ class Member extends DataObject
|
|||||||
__CLASS__ . '.SUBJECTPASSWORDCHANGED',
|
__CLASS__ . '.SUBJECTPASSWORDCHANGED',
|
||||||
"Your password has been changed",
|
"Your password has been changed",
|
||||||
'Email subject'
|
'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
|
// 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))
|
->addData('PasswordResetLink', Security::getPasswordResetLink($member, $token))
|
||||||
->setTo($member->Email);
|
->setTo($member->Email);
|
||||||
|
|
||||||
|
$member->extend('updateForgotPasswordEmail', $email);
|
||||||
return $email->send();
|
return $email->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user