aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_messenger.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2017-06-05 11:13:35 +0200
committerMarc Alexander <admin@m-a-styles.de>2017-06-05 11:13:35 +0200
commitacf9cdba01febd0d5627f20f22e6c61d63519fbc (patch)
tree1d25b101c370c89fe0786e3aea3877c2f6d23a8f /phpBB/includes/functions_messenger.php
parenta6939fcb8ec09b98a4593bb472499bbc5c20d12e (diff)
parentf5d49b61bb0034a7e732bfde680b1bcf9732d5ff (diff)
downloadforums-acf9cdba01febd0d5627f20f22e6c61d63519fbc.tar
forums-acf9cdba01febd0d5627f20f22e6c61d63519fbc.tar.gz
forums-acf9cdba01febd0d5627f20f22e6c61d63519fbc.tar.bz2
forums-acf9cdba01febd0d5627f20f22e6c61d63519fbc.tar.xz
forums-acf9cdba01febd0d5627f20f22e6c61d63519fbc.zip
Merge pull request #4810 from rxu/ticket/15199
[ticket/15199] Add core event to the messenger send() function
Diffstat (limited to 'phpBB/includes/functions_messenger.php')
-rw-r--r--phpBB/includes/functions_messenger.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 9dbf9d5ef9..98975b9d8f 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -312,10 +312,16 @@ class messenger
/**
* 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)
{
- global $config, $user;
+ global $config, $user, $phpbb_dispatcher;
// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(
@@ -324,6 +330,30 @@ class messenger
'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
$this->msg = trim($this->template->assign_display('body'));