Merge pull request #8215 from nupplaphil/task/extract_email

Cleanup enotify & Extract System emails
This commit is contained in:
Hypolite Petovan 2020-02-04 15:10:27 -05:00 committed by GitHub
commit e37b1c8794
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 783 additions and 152 deletions

View file

@ -897,13 +897,13 @@ class User
$password
));
return notification([
'type' => SYSTEM_EMAIL,
'uid' => $user['uid'],
'to_email' => $user['email'],
'subject' => DI::l10n()->t('Registration at %s', $sitename),
'body' => $body
]);
$email = DI::emailer()
->newSystemMail()
->withMessage(DI::l10n()->t('Registration at %s', $sitename), $body)
->forUser($user)
->withRecipient($user['email'])
->build();
return DI::emailer()->send($email);
}
/**
@ -965,15 +965,13 @@ class User
$password
));
return notification([
'uid' => $user['uid'],
'language' => $user['language'],
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
'subject' => DI::l10n()->t('Registration details for %s', $sitename),
'preamble' => $preamble,
'body' => $body
]);
$email = DI::emailer()
->newSystemMail()
->withMessage(DI::l10n()->t('Registration details for %s', $sitename), $preamble, $body)
->forUser($user)
->withRecipient($user['email'])
->build();
return DI::emailer()->send($email);
}
/**