diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-10 13:01:00 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-21 11:03:27 +0100 |
commit | d1f1333f481a6814bb310c934b798d9f594f0b04 (patch) | |
tree | fdebbe0b70cbcd587071a19331d7d545be5f1b30 /src | |
parent | 7ce895bf5e0531b96b2cf0692b9da3814fb742f8 (diff) | |
download | wallabag-d1f1333f481a6814bb310c934b798d9f594f0b04.tar.gz wallabag-d1f1333f481a6814bb310c934b798d9f594f0b04.tar.zst wallabag-d1f1333f481a6814bb310c934b798d9f594f0b04.zip |
CS
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 13 | ||||
-rw-r--r-- | src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index c04720ae..fa682ae7 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | |||
@@ -4,7 +4,6 @@ namespace Wallabag\UserBundle\Mailer; | |||
4 | 4 | ||
5 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; | 5 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; |
6 | use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; | 6 | use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; |
7 | use Symfony\Component\Translation\TranslatorInterface; | ||
8 | 7 | ||
9 | /** | 8 | /** |
10 | * Custom mailer for TwoFactorBundle email. | 9 | * Custom mailer for TwoFactorBundle email. |
@@ -50,11 +49,11 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
50 | /** | 49 | /** |
51 | * Initialize the auth code mailer with the SwiftMailer object. | 50 | * Initialize the auth code mailer with the SwiftMailer object. |
52 | * | 51 | * |
53 | * @param \Swift_Mailer $mailer | 52 | * @param \Swift_Mailer $mailer |
54 | * @param \Twig_Environment $twig | 53 | * @param \Twig_Environment $twig |
55 | * @param string $senderEmail | 54 | * @param string $senderEmail |
56 | * @param string $senderName | 55 | * @param string $senderName |
57 | * @param string $supportUrl | 56 | * @param string $supportUrl |
58 | */ | 57 | */ |
59 | public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl) | 58 | public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl) |
60 | { | 59 | { |
@@ -74,7 +73,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
74 | { | 73 | { |
75 | $template = $this->twig->loadTemplate('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig'); | 74 | $template = $this->twig->loadTemplate('@WallabagUserBundle/Resources/views/TwoFactor/email_auth_code.html.twig'); |
76 | 75 | ||
77 | $subject = $template->renderBlock('subject', array()); | 76 | $subject = $template->renderBlock('subject', array()); |
78 | $bodyHtml = $template->renderBlock('body_html', [ | 77 | $bodyHtml = $template->renderBlock('body_html', [ |
79 | 'user' => $user->getName(), | 78 | 'user' => $user->getName(), |
80 | 'code' => $user->getEmailAuthCode(), | 79 | 'code' => $user->getEmailAuthCode(), |
diff --git a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php index 857cdcbe..fbd7fdd7 100644 --- a/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php +++ b/src/Wallabag/UserBundle/Tests/Mailer/AuthCodeMailerTest.php | |||
@@ -4,8 +4,6 @@ namespace Wallabag\UserBundle\Tests\Mailer; | |||
4 | 4 | ||
5 | use Wallabag\UserBundle\Entity\User; | 5 | use Wallabag\UserBundle\Entity\User; |
6 | use Wallabag\UserBundle\Mailer\AuthCodeMailer; | 6 | use Wallabag\UserBundle\Mailer\AuthCodeMailer; |
7 | use Symfony\Component\Translation\Translator; | ||
8 | use Symfony\Component\Translation\Loader\ArrayLoader; | ||
9 | 7 | ||
10 | /** | 8 | /** |
11 | * @see https://www.pmg.com/blog/integration-testing-swift-mailer/ | 9 | * @see https://www.pmg.com/blog/integration-testing-swift-mailer/ |