diff options
author | Marc Alexander <admin@m-a-styles.de> | 2018-10-28 12:08:45 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2018-10-28 12:08:45 +0100 |
commit | 77b7d9ba69d6dae5e67f2f5bdebc9a7b7226be3b (patch) | |
tree | 8eef609f37408649f655417c8fe4901f42a354f3 /phpBB/includes/functions_messenger.php | |
parent | b5d36645f2f6819d9458550bda399f981c173977 (diff) | |
parent | 2d736479d8f7040d9fbbb12fb7961e329f62bac2 (diff) | |
download | forums-77b7d9ba69d6dae5e67f2f5bdebc9a7b7226be3b.tar forums-77b7d9ba69d6dae5e67f2f5bdebc9a7b7226be3b.tar.gz forums-77b7d9ba69d6dae5e67f2f5bdebc9a7b7226be3b.tar.bz2 forums-77b7d9ba69d6dae5e67f2f5bdebc9a7b7226be3b.tar.xz forums-77b7d9ba69d6dae5e67f2f5bdebc9a7b7226be3b.zip |
Merge pull request #5404 from Elsensee/ticket/15830
[ticket/15830] Move event to a more useful place
Diffstat (limited to 'phpBB/includes/functions_messenger.php')
-rw-r--r-- | phpBB/includes/functions_messenger.php | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 8723dda7ff..4f0d40031d 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -326,10 +326,26 @@ class messenger )); $subject = $this->subject; - $message = $this->msg; - $template = $this->template; + $template = $this->template; /** - * Event to modify notification message text before parsing + * Event to modify the template before parsing + * + * @event core.modify_notification_template + * @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 \phpbb\template\template template The (readonly) template object + * @since 3.2.4-RC1 + */ + $vars = array('method', 'break', 'subject', 'template'); + extract($phpbb_dispatcher->trigger_event('core.modify_notification_template', compact($vars))); + + // Parse message through template + $message = trim($this->template->assign_display('body')); + + /** + * Event to modify notification message text after parsing * * @event core.modify_notification_message * @var int method User notification method NOTIFY_EMAIL|NOTIFY_IM|NOTIFY_BOTH @@ -337,24 +353,14 @@ class messenger * and the message without sending it * @var string subject The message subject * @var string message The message text - * @var \phpbb\template\template template Template object * @since 3.1.11-RC1 - * @changed 3.2.4-RC1 Added template */ - $vars = array( - 'method', - 'break', - 'subject', - 'message', - 'template', - ); + $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')); + unset($subject, $message, $template); // Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding $this->msg = str_replace("\r\n", "\n", $this->msg); |