1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[ticket/17135] Refactor messenger code to services [ci skip]

PHPBB3-17135
This commit is contained in:
rxu
2023-06-08 15:23:09 +07:00
parent 5873c72ca5
commit f95816cbe3
12 changed files with 137 additions and 167 deletions

View File

@@ -720,17 +720,17 @@ class acp_board
{
if ($config['email_enable'])
{
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger(false);
$messenger->template('test');
$messenger->set_addresses($user->data);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
$messenger = $phpbb_container->get('messenger.method_collection');
$email = $messenger->offsetGet('messenger.method.email');
$email->set_use_queue(false);
$email->template('test');
$email->set_addresses($user->data);
$email->anti_abuse_headers($config, $user);
$email->assign_vars([
'USERNAME' => html_entity_decode($user->data['username'], ENT_COMPAT),
'MESSAGE' => html_entity_decode($request->variable('send_test_email_text', '', true), ENT_COMPAT),
));
$messenger->send(NOTIFY_EMAIL);
]);
$email->send();
trigger_error($user->lang('TEST_EMAIL_SENT') . adm_back_link($this->u_action));
}