simplify mail creation

This commit is contained in:
nupplaPhil
2020-02-04 21:04:08 +01:00
parent 9f95b975b4
commit 0b94b84dc7
8 changed files with 32 additions and 25 deletions

View File

@@ -65,9 +65,9 @@ function lostpass_post(App $a)
Login Name: %3$s', $resetlink, DI::baseUrl(), $user['nickname']));
$email = DI::emailer()
->newSystemMail((!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n())
->newSystemMail()
->withMessage(DI::l10n()->t('Password reset requested at %s', $sitename), $preamble, $body)
->forUser($user['uid'] ?? 0)
->forUser($user)
->withRecipient($user['email'])
->build();
@@ -157,9 +157,9 @@ function lostpass_generate_password($user)
', DI::baseUrl(), $user['nickname'], $new_password));
$email = DI::emailer()
->newSystemMail((!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n())
->newSystemMail()
->withMessage(DI::l10n()->t('Your password has been changed at %s', $sitename), $preamble, $body)
->forUser($user['uid'] ?? 0)
->forUser($user)
->withRecipient($user['email'])
->build();
DI::emailer()->send($email);