mirror of
https://github.com/friendica/friendica
synced 2025-04-30 09:44:22 +02:00
Enable addon using emailer hooks to skip default call to mail()
This commit is contained in:
parent
f225752f8a
commit
4e207ef786
2 changed files with 15 additions and 2 deletions
|
@ -32,10 +32,16 @@ class Emailer
|
|||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function send($params)
|
||||
public static function send(array $params)
|
||||
{
|
||||
$params['sent'] = false;
|
||||
|
||||
Hook::callAll('emailer_send_prepare', $params);
|
||||
|
||||
if ($params['sent']) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$email_textonly = false;
|
||||
if (!empty($params['uid'])) {
|
||||
$email_textonly = PConfig::get($params['uid'], "system", "email_textonly");
|
||||
|
@ -87,11 +93,16 @@ class Emailer
|
|||
'subject' => $messageSubject,
|
||||
'body' => $multipartMessageBody,
|
||||
'headers' => $messageHeader,
|
||||
'parameters' => $sendmail_params
|
||||
'parameters' => $sendmail_params,
|
||||
'sent' => false,
|
||||
];
|
||||
|
||||
Hook::callAll("emailer_send", $hookdata);
|
||||
|
||||
if ($hookdata['sent']) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$res = mail(
|
||||
$hookdata['to'],
|
||||
$hookdata['subject'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue