diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-10 12:49:43 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-21 11:03:27 +0100 |
commit | 7ce895bf5e0531b96b2cf0692b9da3814fb742f8 (patch) | |
tree | 0727a190800024fed1b5de08562de8dd815b194b /src/Wallabag/UserBundle/Resources | |
parent | e72a943ad244f8b6349e31eb9a148808045b224b (diff) | |
download | wallabag-7ce895bf5e0531b96b2cf0692b9da3814fb742f8.tar.gz wallabag-7ce895bf5e0531b96b2cf0692b9da3814fb742f8.tar.zst wallabag-7ce895bf5e0531b96b2cf0692b9da3814fb742f8.zip |
Use HTML email for 2FA
Related to #1490
Diffstat (limited to 'src/Wallabag/UserBundle/Resources')
4 files changed, 25 insertions, 9 deletions
diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index 9109b6a3..aa2fd8b9 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml | |||
@@ -3,7 +3,7 @@ services: | |||
3 | class: Wallabag\UserBundle\Mailer\AuthCodeMailer | 3 | class: Wallabag\UserBundle\Mailer\AuthCodeMailer |
4 | arguments: | 4 | arguments: |
5 | - "@mailer" | 5 | - "@mailer" |
6 | - "@translator" | 6 | - "@twig" |
7 | - "%scheb_two_factor.email.sender_email%" | 7 | - "%scheb_two_factor.email.sender_email%" |
8 | - "%scheb_two_factor.email.sender_name%" | 8 | - "%scheb_two_factor.email.sender_name%" |
9 | - "%wallabag_support_url%" | 9 | - "%wallabag_support_url%" |
diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml index f806d1d6..7298bb28 100644 --- a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml +++ b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.en.yml | |||
@@ -1,10 +1,9 @@ | |||
1 | # Two factor mail | 1 | # Two factor mail |
2 | auth_code.mailer.subject: 'Wallabag authentication Code' | 2 | auth_code.mailer.subject: 'Wallabag authentication Code' |
3 | auth_code.mailer.body: | | 3 | auth_code.mailer.body.hello: "Hi %user%," |
4 | Hi %user%, | 4 | auth_code.mailer.body.content: | |
5 | |||
6 | Since you enable two factor authentication on your wallabag account and you just logged in from a new device (computer, phone, etc.), we send you a code to validate your connection. | 5 | Since you enable two factor authentication on your wallabag account and you just logged in from a new device (computer, phone, etc.), we send you a code to validate your connection. |
7 | Here is the code: %code% | 6 | Here is the code: %code% |
8 | 7 | auth_code.mailer.body.signature: | | |
9 | Please don't hesitate to contact us if you have any problems: %support% | 8 | Please don't hesitate to contact us if you have any problems: %support% |
10 | The wallabag team | 9 | The wallabag team |
diff --git a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.fr.yml b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.fr.yml index 386b2d9e..0c492d04 100644 --- a/src/Wallabag/UserBundle/Resources/translations/wallabag_user.fr.yml +++ b/src/Wallabag/UserBundle/Resources/translations/wallabag_user.fr.yml | |||
@@ -1,10 +1,9 @@ | |||
1 | # Two factor mail | 1 | # Two factor mail |
2 | auth_code.mailer.subject: "Code d'authentification wallabag" | 2 | auth_code.mailer.subject: "Code d'authentification wallabag" |
3 | auth_code.mailer.body: | | 3 | auth_code.mailer.body.hello: "Bonjour %user%," |
4 | Bonjour %user%, | 4 | auth_code.mailer.body.content: | |
5 | |||
6 | Comme vous avez activé la double authentification sur votre compte wallabag et que vous venez de vous connecter depuis un nouvel appareil (ordinateur, téléphone, etc.), nous vous envoyons un code pour valider votre connexion. | 5 | Comme vous avez activé la double authentification sur votre compte wallabag et que vous venez de vous connecter depuis un nouvel appareil (ordinateur, téléphone, etc.), nous vous envoyons un code pour valider votre connexion. |
7 | Voici le code à renseigner: %code% | 6 | Voici le code à renseigner: %code% |
8 | 7 | auth_code.mailer.body.signature: | | |
9 | Si vous avez un problème de connexion, n'hésitez pas à contacter le support: %support% | 8 | Si vous avez un problème de connexion, n'hésitez pas à contacter le support: %support% |
10 | L'équipe wallabag | 9 | L'équipe wallabag |
diff --git a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig new file mode 100644 index 00000000..b726d142 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig | |||
@@ -0,0 +1,18 @@ | |||
1 | {% block subject %} | ||
2 | {{ "auth_code.mailer.subject"|trans({}, 'wallabag_user') }} | ||
3 | {% endblock %} | ||
4 | |||
5 | {% block body_html %} | ||
6 | <p><b>{{ "auth_code.mailer.body.hello"|trans({'%user%': user}, 'wallabag_user') }}</b></p> | ||
7 | |||
8 | <p>{{ "auth_code.mailer.body.content"|trans({'%code%': code}, 'wallabag_user') }}</p> | ||
9 | |||
10 | <p>{{ "auth_code.mailer.body.signature"|trans({'%support%': support}, 'wallabag_user') }}</p> | ||
11 | {% endblock %} | ||
12 | |||
13 | {% block body_text %} | ||
14 | {{ "auth_code.mailer.body.hello"|trans({'%user%': user}, 'wallabag_user') }} | ||
15 | |||
16 | {{ "auth_code.mailer.body.content"|trans({'%code%': code}, 'wallabag_user') }} | ||
17 | {{ "auth_code.mailer.body.signature"|trans({'%support%': support}, 'wallabag_user') }} | ||
18 | {% endblock %} | ||