diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 0025e10ea2..d67999ab45 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -314,7 +314,7 @@ class acp_email
$s_priority_options .= '';
$s_priority_options .= '';
- $template->assign_vars(array(
+ $template_data = array(
'S_WARNING' => (sizeof($error)) ? true : false,
'WARNING_MSG' => (sizeof($error)) ? implode('
', $error) : '',
'U_ACTION' => $this->u_action,
@@ -323,8 +323,22 @@ class acp_email
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'),
'SUBJECT' => $subject,
'MESSAGE' => $message,
- 'S_PRIORITY_OPTIONS' => $s_priority_options)
+ 'S_PRIORITY_OPTIONS' => $s_priority_options,
);
+ /**
+ * Modify custom email template data before we display the form
+ *
+ * @event core.acp_email_display
+ * @var array template_data Array with template data assigned to email template
+ * @var array exclude Array with groups which are excluded from group selection
+ * @var array usernames Usernames which will be displayed in form
+ *
+ * @since 3.1.4-RC1
+ */
+ $vars = array('template_data', 'exclude', 'usernames');
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_display', compact($vars)));
+
+ $template->assign_vars($template_data);
}
}