feat(i18n): translate devise related emails

This commit is contained in:
Paul Chavard 2021-08-26 09:50:28 +02:00
parent c553fe1e9a
commit 8c6978c0cb
9 changed files with 102 additions and 1 deletions

View file

@ -0,0 +1,23 @@
-# ugly hack to know if the mail is creation confirmation or a password change confirmation
- if @user.unconfirmed_email.nil?
- content_for(:title, 'Activate account')
%p
Dear Sir or Madam,
%p
You have entered your details to create an account on #{APPLICATION_NAME}. To confirm your email and finish creating your account, select the following link:
- link = confirmation_url(@user, confirmation_token: @token, procedure_id: @procedure&.id)
= link_to(link, link)
- else
- content_for(:title, "Change email address")
%p
Dear Sir or Madam,
%p
To confirm your account email change on #{APPLICATION_NAME}, select the following link:
= link_to(confirmation_url(@user, confirmation_token: @token), confirmation_url(@user, confirmation_token: @token))
= render partial: "layouts/mailers/signature"

View file

@ -0,0 +1,14 @@
- content_for(:title, 'New email address')
%p
Dear Sir or Madam,
- unconfirmed_email = @resource.try(:unconfirmed_email?)
- if unconfirmed_email.present?
%p
We recieved a request to change the email address associated with your account #{@email} on #{APPLICATION_NAME}. The new email address will be #{unconfirmed_email}.
- else
%p
A change to the email address associated with your account #{@email} was made on #{APPLICATION_NAME}. You can now connect with the email address #{@resource.email}.
= render partial: "layouts/mailers/signature"

View file

@ -0,0 +1,9 @@
- content_for(:title, 'New password')
%p
Dear Sir or Madam,
%p
A request to change your password on #{APPLICATION_NAME} for the account #{@resource.email} was successfully processed.
= render partial: "layouts/mailers/signature"

View file

@ -0,0 +1,12 @@
%p
Dear Sir or Madam,
%p
Someone has requested to change your account password on #{APPLICATION_NAME}. To define a new password, select the following link:
= round_button 'Change the password', edit_password_url(@resource, reset_password_token: @token), :primary
%p
If you didn't request this, please ignore this email. Your password won't change.
= render partial: "layouts/mailers/signature"

View file

@ -0,0 +1,15 @@
- content_for(:title, 'Reactivate account')
%p
Dear Sir or Madam,
%p
Someone made too many unsuccessful attempts to connect to your account #{@resource.email} on #{APPLICATION_NAME}.
As a security measure, we temporarily locked access to your account.
%p
To unlock access to your account, select the following link:
%p= link_to 'Unlock account', unlock_url(@resource, unlock_token: @token)
= render partial: "layouts/mailers/signature"

View file

@ -0,0 +1,24 @@
- content_for :procedure_logo do
= render 'layouts/mailers/logo', url: @logo_url
%p
Dear Sir or Madam,
%p
You started filling a File on the procedure:
= succeed '.' do
%strong « #{@dossier.procedure.libelle} »
%p
You can access your File, to review or complete, by clicking on the following button:
= round_button('Access your File', dossier_url(@dossier), :primary)
- if @dossier.procedure.auto_archive_on
%p
Your File needs to be submitted before #{procedure_auto_archive_datetime(@dossier.procedure)}.
= render 'layouts/mailers/signature'
- content_for :footer do
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier

View file

@ -1,5 +1,5 @@
%p
Bonne journée,
= t(:best_regards, scope: [:layouts, :signature])
%br
- if defined?(service) && service && service.nom.present?
= service.nom

View file

@ -53,6 +53,8 @@ en:
line3: administrative forms.
locale_dropdown:
languages: "Languages"
signature:
best_regards: Best Regards,
views:
commencer:
show:

View file

@ -43,6 +43,8 @@ fr:
line3: administratifs dématérialisés.
locale_dropdown:
languages: "Langues"
signature:
best_regards: Bonne journée,
views:
commencer:
show: