]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Emailer.php
Remove unused dependency
[friendica.git] / src / Util / Emailer.php
index 66ebcc307d3341b0284503cfc8812ca71340700c..ed4ea4d87c5606ee0c69297e1df1556384d17284 100644 (file)
@@ -7,10 +7,12 @@ namespace Friendica\Util;
 use Friendica\App;
 use Friendica\Core\Config\IConfig;
 use Friendica\Core\Hook;
+use Friendica\Core\L10n;
 use Friendica\Core\PConfig\IPConfig;
 use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Object\EMail\IEmail;
 use Friendica\Protocol\Email;
+use Friendica\Util\EMailer\SystemMailBuilder;
 use Psr\Log\LoggerInterface;
 
 /**
@@ -35,6 +37,18 @@ class Emailer
                $this->baseUrl     = $baseURL;
        }
 
+       /**
+        * Creates a new system email
+        *
+        * @param L10n $l10n The chosen language for the new email
+        *
+        * @return SystemMailBuilder
+        */
+       public function newSystemMail(L10n $l10n)
+       {
+               return new SystemMailBuilder($l10n, $this->baseUrl, $this->config);
+       }
+
        /**
         * Send a multipart/alternative message with Text and HTML versions
         *
@@ -45,12 +59,8 @@ class Emailer
         */
        public function send(IEmail $email)
        {
-               $this->logger->debug('start emailing', ['email' => $email]);
-
                Hook::callAll('emailer_send_prepare', $email);
 
-               $this->logger->debug('End Hook call', ['email' => $email]);
-
                if (empty($email)) {
                        return true;
                }