diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-20 17:43:10 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-21 11:03:27 +0100 |
commit | abd454c45633e335d9d63bcd250e760b968f8138 (patch) | |
tree | a616f79e642b9683b3c7b597ed9c4072c0af5cdf /src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | |
parent | 5f736213af209b0457e4e9d62f06fd5f46652f5f (diff) | |
download | wallabag-abd454c45633e335d9d63bcd250e760b968f8138.tar.gz wallabag-abd454c45633e335d9d63bcd250e760b968f8138.tar.zst wallabag-abd454c45633e335d9d63bcd250e760b968f8138.zip |
Update HTML 2FA template
Split paragraph in translation
Inject wallabag_url for image in HTML template
Remove username & password from config_dev.yml (null are already the default value)
Diffstat (limited to 'src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php')
-rw-r--r-- | src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index fa682ae7..6b108dd3 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | |||
@@ -47,6 +47,13 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
47 | private $supportUrl; | 47 | private $supportUrl; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Url for the wallabag instance. | ||
51 | * | ||
52 | * @var string | ||
53 | */ | ||
54 | private $wallabagUrl; | ||
55 | |||
56 | /** | ||
50 | * Initialize the auth code mailer with the SwiftMailer object. | 57 | * Initialize the auth code mailer with the SwiftMailer object. |
51 | * | 58 | * |
52 | * @param \Swift_Mailer $mailer | 59 | * @param \Swift_Mailer $mailer |
@@ -54,14 +61,16 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
54 | * @param string $senderEmail | 61 | * @param string $senderEmail |
55 | * @param string $senderName | 62 | * @param string $senderName |
56 | * @param string $supportUrl | 63 | * @param string $supportUrl |
64 | * @param string $wallabagUrl | ||
57 | */ | 65 | */ |
58 | public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl) | 66 | public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) |
59 | { | 67 | { |
60 | $this->mailer = $mailer; | 68 | $this->mailer = $mailer; |
61 | $this->twig = $twig; | 69 | $this->twig = $twig; |
62 | $this->senderEmail = $senderEmail; | 70 | $this->senderEmail = $senderEmail; |
63 | $this->senderName = $senderName; | 71 | $this->senderName = $senderName; |
64 | $this->supportUrl = $supportUrl; | 72 | $this->supportUrl = $supportUrl; |
73 | $this->wallabagUrl = $wallabagUrl; | ||
65 | } | 74 | } |
66 | 75 | ||
67 | /** | 76 | /** |
@@ -77,12 +86,13 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
77 | $bodyHtml = $template->renderBlock('body_html', [ | 86 | $bodyHtml = $template->renderBlock('body_html', [ |
78 | 'user' => $user->getName(), | 87 | 'user' => $user->getName(), |
79 | 'code' => $user->getEmailAuthCode(), | 88 | 'code' => $user->getEmailAuthCode(), |
80 | 'support' => $this->supportUrl, | 89 | 'support_url' => $this->supportUrl, |
90 | 'wallabag_url' => $this->wallabagUrl, | ||
81 | ]); | 91 | ]); |
82 | $bodyText = $template->renderBlock('body_text', [ | 92 | $bodyText = $template->renderBlock('body_text', [ |
83 | 'user' => $user->getName(), | 93 | 'user' => $user->getName(), |
84 | 'code' => $user->getEmailAuthCode(), | 94 | 'code' => $user->getEmailAuthCode(), |
85 | 'support' => $this->supportUrl, | 95 | 'support_url' => $this->supportUrl, |
86 | ]); | 96 | ]); |
87 | 97 | ||
88 | $message = new \Swift_Message(); | 98 | $message = new \Swift_Message(); |