mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 01:24:27 +02:00
Extract System emails from enotify
- Removed every SYSTEM_EMAIL occurrence in enotify - Introduced a "SystemMailBuilder" for build system emails - Replaced every SYSTEM_EMAIL usage in the classes with calling this builder - Added tests for this new Builder - Split the email templates between "base" template for email and concrete usages for different use cases
This commit is contained in:
parent
74490d6594
commit
3291728059
18 changed files with 647 additions and 118 deletions
|
@ -40,17 +40,16 @@ function removeme_post(App $a)
|
|||
if (!DBA::isResult($admin)) {
|
||||
continue;
|
||||
}
|
||||
notification([
|
||||
'type' => SYSTEM_EMAIL,
|
||||
'subject' => DI::l10n()->t('[Friendica System Notify]') . ' ' . DI::l10n()->t('User deleted their account'),
|
||||
'preamble' => DI::l10n()->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
|
||||
'body' => DI::l10n()->t('The user id is %d', local_user()),
|
||||
'to_email' => $admin['email'],
|
||||
'to_name' => $admin['username'],
|
||||
'uid' => $admin['uid'],
|
||||
'language' => $admin['language'] ? $admin['language'] : 'en',
|
||||
'show_in_notification_page' => false
|
||||
]);
|
||||
|
||||
$email = DI::emailer()
|
||||
->newSystemMail((!empty($admin['language'])) ? DI::l10n()->withLang($admin['language']) : DI::l10n()->withLang('en'))
|
||||
->withMessage(DI::l10n()->t('[Friendica System Notify]') . ' ' . DI::l10n()->t('User deleted their account'),
|
||||
DI::l10n()->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
|
||||
DI::l10n()->t('The user id is %d', local_user()))
|
||||
->forUser($admin['uid'] ?? 0)
|
||||
->withRecipient($admin['email'])
|
||||
->build();
|
||||
DI::emailer()->send($email);
|
||||
}
|
||||
|
||||
if (User::getIdFromPasswordAuthentication($a->user, trim($_POST['qxz_password']))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue