Make EMailer util dynamic

This commit is contained in:
Philipp Holzer 2020-01-25 23:10:39 +01:00
parent 9269221825
commit ea9d3b7438
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
4 changed files with 11 additions and 3 deletions

View File

@ -610,7 +610,7 @@ function notification($params)
]); ]);
// use the Emailer class to send the message // use the Emailer class to send the message
return Emailer::send([ return DI::emailer()->send([
'uid' => $params['uid'], 'uid' => $params['uid'],
'fromName' => $sender_name, 'fromName' => $sender_name,
'fromEmail' => $sender_email, 'fromEmail' => $sender_email,

View File

@ -816,7 +816,7 @@ function item_post(App $a) {
'htmlVersion' => $message, 'htmlVersion' => $message,
'textVersion' => HTML::toPlaintext($html.$disclaimer) 'textVersion' => HTML::toPlaintext($html.$disclaimer)
]; ];
Emailer::send($params); DI::emailer()->send($params);
} }
} }
} }

View File

@ -363,4 +363,12 @@ abstract class DI
{ {
return self::$dice->create(Util\Profiler::class); return self::$dice->create(Util\Profiler::class);
} }
/**
* @return Util\Emailer
*/
public static function emailer()
{
return self::$dice->create(Util\Emailer::class);
}
} }

View File

@ -31,7 +31,7 @@ class Emailer
* @return bool * @return bool
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
public static function send(array $params) public function send(array $params)
{ {
$params['sent'] = false; $params['sent'] = false;