]> git.mxchange.org Git - friendica.git/commitdiff
Make EMailer util dynamic
authornupplaPhil <admin@philipp.info>
Sat, 25 Jan 2020 22:10:39 +0000 (23:10 +0100)
committernupplaPhil <admin@philipp.info>
Sun, 26 Jan 2020 20:35:03 +0000 (21:35 +0100)
include/enotify.php
mod/item.php
src/DI.php
src/Util/Emailer.php

index 144460693d1fc58ec2aea0df3bf1e5cc172f5fcf..75ad7ef1fa11a2d6edccce035a5625a83f7272f8 100644 (file)
@@ -610,7 +610,7 @@ function notification($params)
                ]);
 
                // use the Emailer class to send the message
-               return Emailer::send([
+               return DI::emailer()->send([
                        'uid' => $params['uid'],
                        'fromName' => $sender_name,
                        'fromEmail' => $sender_email,
index a9c5d43580794d660e7fa2a83099c994bd36c6a4..a5ff594a0c282bd29d4de14d8cc33ab423b55ffa 100644 (file)
@@ -816,7 +816,7 @@ function item_post(App $a) {
                                        'htmlVersion' => $message,
                                        'textVersion' => HTML::toPlaintext($html.$disclaimer)
                                ];
-                               Emailer::send($params);
+                               DI::emailer()->send($params);
                        }
                }
        }
index 3034bd971c6c371f06a905d342b2a6be6565710f..6eb1ed4b633c17d73c2f67cef8495f5063cdd8c4 100644 (file)
@@ -363,4 +363,12 @@ abstract class DI
        {
                return self::$dice->create(Util\Profiler::class);
        }
+
+       /**
+        * @return Util\Emailer
+        */
+       public static function emailer()
+       {
+               return self::$dice->create(Util\Emailer::class);
+       }
 }
index 41835b6609b7abe210cb91836645d71d1df2ee3f..776d3592163582d77193b0027d2ffbbe1291f986 100644 (file)
@@ -31,7 +31,7 @@ class Emailer
         * @return bool
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function send(array $params)
+       public function send(array $params)
        {
                $params['sent'] = false;