mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16879] Add events to phpbb_mail()
PHPBB3-16879
This commit is contained in:
parent
54b54c41c6
commit
303a933403
1 changed files with 23 additions and 1 deletions
|
@ -1935,10 +1935,32 @@ function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
|
||||||
*/
|
*/
|
||||||
$additional_parameters = $config['email_force_sender'] ? '-f' . $config['board_email'] : '';
|
$additional_parameters = $config['email_force_sender'] ? '-f' . $config['board_email'] : '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modify data before sending out emails with the PHP's mail function
|
||||||
|
*
|
||||||
|
* @event core.phpbb_mail_before
|
||||||
|
* @var string to The message recipient
|
||||||
|
* @var string subject The message subject
|
||||||
|
* @var string msg The message text
|
||||||
|
* @var string headers The email headers
|
||||||
|
* @var string eol The endline character
|
||||||
|
* @var string additional_parameters The additional parameters
|
||||||
|
* @since 3.3.5-RC1
|
||||||
|
*/
|
||||||
|
$vars = [
|
||||||
|
'to',
|
||||||
|
'subject',
|
||||||
|
'msg',
|
||||||
|
'headers',
|
||||||
|
'eol',
|
||||||
|
'additional_parameters',
|
||||||
|
];
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.phpbb_mail_before', compact($vars)));
|
||||||
|
|
||||||
$result = mail($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers, $additional_parameters);
|
$result = mail($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers, $additional_parameters);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement some code after sending out emails with the PHP's mail function
|
* Execute code after sending out emails with the PHP's mail function
|
||||||
*
|
*
|
||||||
* @event core.phpbb_mail_after
|
* @event core.phpbb_mail_after
|
||||||
* @var string to The message recipient
|
* @var string to The message recipient
|
||||||
|
|
Loading…
Add table
Reference in a new issue