mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00: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:
parent
212971a3a6
commit
ebb5169a46
2 changed files with 19 additions and 1 deletions
|
@ -55,6 +55,24 @@ class messenger
|
||||||
$this->vars = $this->msg = $this->replyto = $this->from = '';
|
$this->vars = $this->msg = $this->replyto = $this->from = '';
|
||||||
$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'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue