mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE Deprecate Member::sendInfo(), use Member_ChangePasswordEmail and Member_ForgotPasswordEmail class directly instead.
This commit is contained in:
parent
fd0ec1c47f
commit
d4154dae9e
@ -478,6 +478,8 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
* @param array $data Additional data to pass to the email (can be used in the template)
|
* @param array $data Additional data to pass to the email (can be used in the template)
|
||||||
*/
|
*/
|
||||||
function sendInfo($type = 'signup', $data = null) {
|
function sendInfo($type = 'signup', $data = null) {
|
||||||
|
Deprecation::notice('3.0', 'Please use Member_ChangePasswordEmail or Member_ForgotPasswordEmail directly instead');
|
||||||
|
|
||||||
switch($type) {
|
switch($type) {
|
||||||
case "changePassword":
|
case "changePassword":
|
||||||
$e = Member_ChangePasswordEmail::create();
|
$e = Member_ChangePasswordEmail::create();
|
||||||
@ -644,7 +646,10 @@ class Member extends DataObject implements TemplateGlobalProvider {
|
|||||||
&& $this->record['Password']
|
&& $this->record['Password']
|
||||||
&& Member::$notify_password_change
|
&& Member::$notify_password_change
|
||||||
) {
|
) {
|
||||||
$this->sendInfo('changePassword');
|
$e = Member_ChangePasswordEmail::create();
|
||||||
|
$e->populateTemplate($this);
|
||||||
|
$e->setTo($this->Email);
|
||||||
|
$e->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The test on $this->ID is used for when records are initially created.
|
// The test on $this->ID is used for when records are initially created.
|
||||||
|
@ -258,12 +258,13 @@ JS
|
|||||||
if($member) {
|
if($member) {
|
||||||
$member->generateAutologinHash();
|
$member->generateAutologinHash();
|
||||||
|
|
||||||
$member->sendInfo(
|
$e = Member_ForgotPasswordEmail::create();
|
||||||
'forgotPassword',
|
$e->populateTemplate($member);
|
||||||
array(
|
$e->populateTemplate(array(
|
||||||
'PasswordResetLink' => Security::getPasswordResetLink($member->AutoLoginHash)
|
'PasswordResetLink' => Security::getPasswordResetLink($member->AutoLoginHash)
|
||||||
)
|
));
|
||||||
);
|
$e->setTo($member->Email);
|
||||||
|
$e->send();
|
||||||
|
|
||||||
$this->controller->redirect('Security/passwordsent/' . urlencode($data['Email']));
|
$this->controller->redirect('Security/passwordsent/' . urlencode($data['Email']));
|
||||||
} elseif($data['Email']) {
|
} elseif($data['Email']) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user