mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 15:27:42 +02:00
[ticket/11454] Add messenger function set_addresses
Automatically fills to/im from a user row Send messenger the Jabber address if using Jabber notifications PHPBB3-11454
This commit is contained in:
committed by
Nathan Guse
parent
212971a3a6
commit
ebb5169a46
@@ -56,6 +56,24 @@ class messenger
|
|||||||
$this->mail_priority = MAIL_NORMAL_PRIORITY;
|
$this->mail_priority = MAIL_NORMAL_PRIORITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set addresses for to/im as available
|
||||||
|
*
|
||||||
|
* @param array $user User row
|
||||||
|
*/
|
||||||
|
function set_addresses($user)
|
||||||
|
{
|
||||||
|
if ($user['user_email'])
|
||||||
|
{
|
||||||
|
$this->to($user['user_email'], ($user['username']) ?: '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user['user_jabber'])
|
||||||
|
{
|
||||||
|
$this->im($user['user_jabber'], ($user['username']) ?: '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets an email address to send to
|
* Sets an email address to send to
|
||||||
*/
|
*/
|
||||||
|
@@ -80,7 +80,7 @@ abstract class phpbb_notification_method_messenger_base extends phpbb_notificati
|
|||||||
|
|
||||||
$messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']);
|
$messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']);
|
||||||
|
|
||||||
$messenger->to($user['user_email'], $user['username']);
|
$messenger->set_addresses($user);
|
||||||
|
|
||||||
$messenger->assign_vars(array_merge(array(
|
$messenger->assign_vars(array_merge(array(
|
||||||
'USERNAME' => $user['username'],
|
'USERNAME' => $user['username'],
|
||||||
|
Reference in New Issue
Block a user