X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FUserBundle%2FMailer%2FAuthCodeMailer.php;h=2797efde9edb3aa90c4ea4199c9f1f6a185351a7;hb=9f0957b831622ee577fa7d8f92ec0df6f3a8e274;hp=6b108dd3ef2a7605720b3cab8c451e45557c8f88;hpb=85ad629a3ca209907effd75f5fd7f384f42361bc;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index 6b108dd3..2797efde 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php @@ -2,8 +2,8 @@ namespace Wallabag\UserBundle\Mailer; -use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; +use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; /** * Custom mailer for TwoFactorBundle email. @@ -47,7 +47,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface private $supportUrl; /** - * Url for the wallabag instance. + * Url for the wallabag instance (only used for image in the HTML email template). * * @var string */ @@ -60,8 +60,8 @@ class AuthCodeMailer implements AuthCodeMailerInterface * @param \Twig_Environment $twig * @param string $senderEmail * @param string $senderName - * @param string $supportUrl - * @param string $wallabagUrl + * @param string $supportUrl wallabag support url + * @param string $wallabagUrl wallabag instance url */ public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) { @@ -78,11 +78,11 @@ class AuthCodeMailer implements AuthCodeMailerInterface * * @param TwoFactorInterface $user */ - public function sendAuthCode(TwoFactorInterface $user) + public function sendAuthCode(TwoFactorInterface $user): void { - $template = $this->twig->loadTemplate('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig'); + $template = $this->twig->loadTemplate('WallabagUserBundle:TwoFactor:email_auth_code.html.twig'); - $subject = $template->renderBlock('subject', array()); + $subject = $template->renderBlock('subject', []); $bodyHtml = $template->renderBlock('body_html', [ 'user' => $user->getName(), 'code' => $user->getEmailAuthCode(), @@ -97,7 +97,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface $message = new \Swift_Message(); $message - ->setTo($user->getEmail()) + ->setTo($user->getEmailAuthRecipient()) ->setFrom($this->senderEmail, $this->senderName) ->setSubject($subject) ->setBody($bodyText, 'text/plain')