mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-26 01:04:10 +02:00
[ticket/15199] Add core event to the messenger send() function
PHPBB3-15199
This commit is contained in:
parent
e53343857a
commit
f5d49b61bb
@ -312,10 +312,16 @@ class messenger
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send the mail out to the recipients set previously in var $this->addresses
|
* Send the mail out to the recipients set previously in var $this->addresses
|
||||||
|
*
|
||||||
|
* @param int $method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
|
||||||
|
* @param bool $break Flag indicating if the function only formats the subject
|
||||||
|
* and the message without sending it
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function send($method = NOTIFY_EMAIL, $break = false)
|
function send($method = NOTIFY_EMAIL, $break = false)
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user, $phpbb_dispatcher;
|
||||||
|
|
||||||
// We add some standard variables we always use, no need to specify them always
|
// We add some standard variables we always use, no need to specify them always
|
||||||
$this->assign_vars(array(
|
$this->assign_vars(array(
|
||||||
@ -324,6 +330,30 @@ class messenger
|
|||||||
'SITENAME' => htmlspecialchars_decode($config['sitename']),
|
'SITENAME' => htmlspecialchars_decode($config['sitename']),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$subject = $this->subject;
|
||||||
|
$message = $this->msg;
|
||||||
|
/**
|
||||||
|
* Event to modify notification message text before parsing
|
||||||
|
*
|
||||||
|
* @event core.modify_notification_message
|
||||||
|
* @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH
|
||||||
|
* @var bool break Flag indicating if the function only formats the subject
|
||||||
|
* and the message without sending it
|
||||||
|
* @var string subject The message subject
|
||||||
|
* @var string message The message text
|
||||||
|
* @since 3.1.11-RC1
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'method',
|
||||||
|
'break',
|
||||||
|
'subject',
|
||||||
|
'message',
|
||||||
|
);
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.modify_notification_message', compact($vars)));
|
||||||
|
$this->subject = $subject;
|
||||||
|
$this->msg = $message;
|
||||||
|
unset($subject, $message);
|
||||||
|
|
||||||
// Parse message through template
|
// Parse message through template
|
||||||
$this->msg = trim($this->template->assign_display('body'));
|
$this->msg = trim($this->template->assign_display('body'));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user