]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
Update HTML 2FA template
[github/wallabag/wallabag.git] / src / Wallabag / UserBundle / Mailer / AuthCodeMailer.php
index fa682ae75025d6ee18fafbf379fab5cf79e01db1..6b108dd3ef2a7605720b3cab8c451e45557c8f88 100644 (file)
@@ -46,6 +46,13 @@ class AuthCodeMailer implements AuthCodeMailerInterface
      */
     private $supportUrl;
 
+    /**
+     * Url for the wallabag instance.
+     *
+     * @var string
+     */
+    private $wallabagUrl;
+
     /**
      * Initialize the auth code mailer with the SwiftMailer object.
      *
@@ -54,14 +61,16 @@ class AuthCodeMailer implements AuthCodeMailerInterface
      * @param string            $senderEmail
      * @param string            $senderName
      * @param string            $supportUrl
+     * @param string            $wallabagUrl
      */
-    public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl)
+    public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl)
     {
         $this->mailer = $mailer;
         $this->twig = $twig;
         $this->senderEmail = $senderEmail;
         $this->senderName = $senderName;
         $this->supportUrl = $supportUrl;
+        $this->wallabagUrl = $wallabagUrl;
     }
 
     /**
@@ -77,12 +86,13 @@ class AuthCodeMailer implements AuthCodeMailerInterface
         $bodyHtml = $template->renderBlock('body_html', [
             'user' => $user->getName(),
             'code' => $user->getEmailAuthCode(),
-            'support' => $this->supportUrl,
+            'support_url' => $this->supportUrl,
+            'wallabag_url' => $this->wallabagUrl,
         ]);
         $bodyText = $template->renderBlock('body_text', [
             'user' => $user->getName(),
             'code' => $user->getEmailAuthCode(),
-            'support' => $this->supportUrl,
+            'support_url' => $this->supportUrl,
         ]);
 
         $message = new \Swift_Message();