Merge pull request #6436 from tchak/feat-save-user-locale
feat(i18n): use locale from user preferences when sending notifications
This commit is contained in:
commit
1f23295f91
25 changed files with 196 additions and 181 deletions
|
@ -78,6 +78,9 @@ class ApplicationController < ActionController::Base
|
|||
def set_locale(locale)
|
||||
if locale && locale.to_sym.in?(I18n.available_locales)
|
||||
cookies[:locale] = locale
|
||||
if user_signed_in?
|
||||
current_user.update(locale: locale)
|
||||
end
|
||||
locale
|
||||
end
|
||||
end
|
||||
|
@ -322,6 +325,7 @@ class ApplicationController < ActionController::Base
|
|||
def switch_locale(&action)
|
||||
locale = extract_locale_from_query_params ||
|
||||
extract_locale_from_cookie ||
|
||||
extract_locale_from_user ||
|
||||
extract_locale_from_accept_language_header ||
|
||||
I18n.default_locale
|
||||
|
||||
|
@ -332,6 +336,10 @@ class ApplicationController < ActionController::Base
|
|||
set_locale(request.query_parameters[:locale])
|
||||
end
|
||||
|
||||
def extract_locale_from_user
|
||||
current_user&.locale
|
||||
end
|
||||
|
||||
def extract_locale_from_cookie
|
||||
cookies[:locale]
|
||||
end
|
||||
|
|
|
@ -5,62 +5,74 @@ class DossierMailer < ApplicationMailer
|
|||
helper ProcedureHelper
|
||||
|
||||
layout 'mailers/layout'
|
||||
default from: NO_REPLY_EMAIL
|
||||
|
||||
def notify_new_draft(dossier)
|
||||
I18n.with_locale(dossier.user_locale) do
|
||||
@dossier = dossier
|
||||
@service = dossier.procedure.service
|
||||
@logo_url = attach_logo(dossier.procedure)
|
||||
@subject = default_i18n_subject(libelle_demarche: dossier.procedure.libelle)
|
||||
|
||||
subject = "Retrouvez votre brouillon pour la démarche « #{dossier.procedure.libelle} »"
|
||||
|
||||
mail(from: NO_REPLY_EMAIL, to: dossier.user_email_for(:notification), subject: subject) do |format|
|
||||
mail(to: dossier.user_email_for(:notification), subject: @subject) do |format|
|
||||
format.html { render layout: 'mailers/notifications_layout' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def notify_new_answer(dossier, body = nil)
|
||||
I18n.with_locale(dossier.user_locale) do
|
||||
@dossier = dossier
|
||||
@service = dossier.procedure.service
|
||||
@logo_url = attach_logo(dossier.procedure)
|
||||
@body = body
|
||||
@subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle)
|
||||
|
||||
subject = "Nouveau message pour votre dossier nº #{dossier.id} (#{dossier.procedure.libelle})"
|
||||
|
||||
mail(from: NO_REPLY_EMAIL, to: dossier.user_email_for(:notification), subject: subject) do |format|
|
||||
mail(to: dossier.user_email_for(:notification), subject: @subject) do |format|
|
||||
format.html { render layout: 'mailers/notifications_layout' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def notify_new_commentaire_to_instructeur(dossier, instructeur_email)
|
||||
I18n.with_locale(dossier.user_locale) do
|
||||
@dossier = dossier
|
||||
@subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle)
|
||||
mail(from: NO_REPLY_EMAIL, to: instructeur_email, subject: @subject)
|
||||
|
||||
mail(to: instructeur_email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_new_dossier_depose_to_instructeur(dossier, instructeur_email)
|
||||
I18n.with_locale(dossier.user_locale) do
|
||||
@dossier = dossier
|
||||
@subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle)
|
||||
mail(from: NO_REPLY_EMAIL, to: instructeur_email, subject: @subject)
|
||||
|
||||
mail(to: instructeur_email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_revert_to_instruction(dossier)
|
||||
I18n.with_locale(dossier.user_locale) do
|
||||
@dossier = dossier
|
||||
@service = dossier.procedure.service
|
||||
@logo_url = attach_logo(dossier.procedure)
|
||||
@subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle)
|
||||
|
||||
subject = "Votre dossier nº #{@dossier.id} est en train d’être réexaminé"
|
||||
|
||||
mail(from: NO_REPLY_EMAIL, to: dossier.user_email_for(:notification), subject: subject) do |format|
|
||||
mail(to: dossier.user_email_for(:notification), subject: @subject) do |format|
|
||||
format.html { render layout: 'mailers/notifications_layout' }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def notify_brouillon_near_deletion(dossiers, to_email)
|
||||
I18n.with_locale(dossiers.first.user_locale) do
|
||||
@subject = default_i18n_subject(count: dossiers.count)
|
||||
@dossiers = dossiers
|
||||
|
||||
mail(to: to_email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_brouillon_deletion(dossier_hashes, to_email)
|
||||
@subject = default_i18n_subject(count: dossier_hashes.count)
|
||||
|
@ -70,24 +82,21 @@ class DossierMailer < ApplicationMailer
|
|||
end
|
||||
|
||||
def notify_deletion_to_user(deleted_dossier, to_email)
|
||||
I18n.with_locale(deleted_dossier.user_locale) do
|
||||
@subject = default_i18n_subject(dossier_id: deleted_dossier.dossier_id)
|
||||
@deleted_dossier = deleted_dossier
|
||||
|
||||
mail(to: to_email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_instructeur_deletion_to_user(deleted_dossier, to_email)
|
||||
I18n.with_locale(deleted_dossier.user_locale) do
|
||||
@subject = default_i18n_subject(libelle_demarche: deleted_dossier.procedure.libelle)
|
||||
@deleted_dossier = deleted_dossier
|
||||
|
||||
mail(to: to_email, subject: @subject)
|
||||
end
|
||||
|
||||
def notify_instructeur(deleted_dossier, to_email)
|
||||
@subject = default_i18n_subject(dossier_id: deleted_dossier.dossier_id)
|
||||
@deleted_dossier = deleted_dossier
|
||||
|
||||
mail(to: to_email, subject: @subject)
|
||||
end
|
||||
|
||||
def notify_deletion_to_administration(deleted_dossier, to_email)
|
||||
|
@ -98,12 +107,14 @@ class DossierMailer < ApplicationMailer
|
|||
end
|
||||
|
||||
def notify_automatic_deletion_to_user(deleted_dossiers, to_email)
|
||||
I18n.with_locale(deleted_dossiers.first.user_locale) do
|
||||
@state = deleted_dossiers.first.state
|
||||
@subject = default_i18n_subject(count: deleted_dossiers.count)
|
||||
@deleted_dossiers = deleted_dossiers
|
||||
|
||||
mail(to: to_email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_automatic_deletion_to_administration(deleted_dossiers, to_email)
|
||||
@subject = default_i18n_subject(count: deleted_dossiers.count)
|
||||
|
@ -113,12 +124,14 @@ class DossierMailer < ApplicationMailer
|
|||
end
|
||||
|
||||
def notify_near_deletion_to_user(dossiers, to_email)
|
||||
I18n.with_locale(dossiers.first.user_locale) do
|
||||
@state = dossiers.first.state
|
||||
@subject = default_i18n_subject(count: dossiers.count, state: @state)
|
||||
@dossiers = dossiers
|
||||
|
||||
mail(to: to_email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_near_deletion_to_administration(dossiers, to_email)
|
||||
@state = dossiers.first.state
|
||||
|
@ -129,19 +142,20 @@ class DossierMailer < ApplicationMailer
|
|||
end
|
||||
|
||||
def notify_groupe_instructeur_changed(instructeur, dossier)
|
||||
@subject = "Un dossier a changé de groupe instructeur"
|
||||
@dossier_id = dossier.id
|
||||
@demarche = dossier.procedure.libelle
|
||||
@subject = default_i18n_subject(dossier_id: dossier.id)
|
||||
@dossier = dossier
|
||||
|
||||
mail(from: NO_REPLY_EMAIL, to: instructeur.email, subject: @subject)
|
||||
mail(to: instructeur.email, subject: @subject)
|
||||
end
|
||||
|
||||
def notify_brouillon_not_submitted(dossier)
|
||||
@subject = "Attention : votre dossier n’est pas déposé."
|
||||
I18n.with_locale(dossier.user_locale) do
|
||||
@subject = default_i18n_subject(dossier_id: dossier.id)
|
||||
@dossier = dossier
|
||||
|
||||
mail(to: dossier.user_email_for(:notification), subject: @subject)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
|
|
@ -22,8 +22,10 @@ class NotificationMailer < ApplicationMailer
|
|||
@logo_url = attach_logo(@dossier.procedure)
|
||||
@rendered_template = sanitize(@body)
|
||||
|
||||
I18n.with_locale(@dossier.user_locale) do
|
||||
mail(subject: @subject, to: @email, template_name: 'send_notification')
|
||||
end
|
||||
end
|
||||
|
||||
def self.send_en_construction_notification(dossier)
|
||||
with(dossier: dossier, state: Dossier.states.fetch(:en_construction)).send_notification
|
||||
|
@ -53,6 +55,7 @@ class NotificationMailer < ApplicationMailer
|
|||
if @dossier.user_deleted?
|
||||
mail.perform_deliveries = false
|
||||
else
|
||||
I18n.with_locale(@dossier.user_locale) do
|
||||
mail_template = @dossier.procedure.mail_template_for(params[:state])
|
||||
|
||||
@email = @dossier.user_email_for(:notification)
|
||||
|
@ -61,6 +64,7 @@ class NotificationMailer < ApplicationMailer
|
|||
@actions = mail_template.actions_for_dossier(@dossier)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create_commentaire_for_notification
|
||||
body = ["[#{@subject}]", @body].join("<br><br>")
|
||||
|
|
|
@ -47,4 +47,8 @@ class DeletedDossier < ApplicationRecord
|
|||
def procedure_removed?
|
||||
reason == self.class.reasons.fetch(:procedure_removed)
|
||||
end
|
||||
|
||||
def user_locale
|
||||
User.find_by(id: user_id)&.locale || I18n.default_locale
|
||||
end
|
||||
end
|
||||
|
|
|
@ -921,6 +921,10 @@ class Dossier < ApplicationRecord
|
|||
update_column(:api_entreprise_job_exceptions, exceptions)
|
||||
end
|
||||
|
||||
def user_locale
|
||||
user&.locale || I18n.default_locale
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def defaut_groupe_instructeur?
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# failed_attempts :integer default(0), not null
|
||||
# last_sign_in_at :datetime
|
||||
# last_sign_in_ip :string
|
||||
# locale :string
|
||||
# locked_at :datetime
|
||||
# loged_in_with_france_connect :string default(NULL)
|
||||
# remember_created_at :datetime
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
%p
|
||||
= "Vous suiviez jusqu'à maintenant le dossier n°#{@dossier_id} de la démarche #{@demarche}."
|
||||
= "Vous suiviez jusqu'à maintenant le dossier n° #{@dossier.id} de la démarche #{@dossier.procedure.libelle}."
|
||||
L’usager a modifié le groupe de routage. Son dossier appartient maintenant à un groupe instructeur dont vous ne faites pas partie.
|
||||
%p
|
||||
Suite à cette modification, vous ne suivez plus ce dossier.
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
- content_for :procedure_logo do
|
||||
= render 'layouts/mailers/logo', url: @logo_url
|
||||
|
||||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
- if !@dossier.brouillon?
|
||||
%p
|
||||
You received
|
||||
%strong a new message
|
||||
from the service in charge of examine your File.
|
||||
%p
|
||||
To read the message and answer it, select the following link:
|
||||
|
||||
= round_button('Read the message', messagerie_dossier_url(@dossier), :primary)
|
||||
- else
|
||||
%p
|
||||
You received
|
||||
%strong a new message
|
||||
from the service in charge of examine the File you started a draft for on the procedure #{@dossier.procedure.libelle}.
|
||||
%p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 14px;" }
|
||||
= @body
|
||||
|
||||
%p
|
||||
If you chose to contact the service, please use the email available below in the page.
|
||||
|
||||
= round_button('Open the File', dossier_url(@dossier), :primary)
|
||||
|
||||
= render 'layouts/mailers/signature', service: @service
|
||||
|
||||
- content_for :footer do
|
||||
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier
|
|
@ -4,25 +4,15 @@
|
|||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
- if !@dossier.brouillon?
|
||||
%p
|
||||
Vous avez reçu un
|
||||
%strong nouveau message
|
||||
de la part du service en charge de votre dossier.
|
||||
%p
|
||||
Pour consulter le message et y répondre, cliquez sur le bouton ci-dessous :
|
||||
|
||||
= round_button('Lire le message', messagerie_dossier_url(@dossier), :primary)
|
||||
%p= t('.body', libelle_demarche: @dossier.procedure.libelle)
|
||||
%p= t('.link')
|
||||
= round_button(t('.access_message'), messagerie_dossier_url(@dossier), :primary)
|
||||
- else
|
||||
%p
|
||||
Vous avez reçu un
|
||||
%strong nouveau message
|
||||
du service pour lequel votre dossier est en brouillon pour la démarche #{@dossier.procedure.libelle}.
|
||||
%p= t('.body_draft', libelle_demarche: @dossier.procedure.libelle)
|
||||
%p{ style: "padding: 8px; color: #333333; background-color: #EEEEEE; font-size: 14px;" }
|
||||
= @body
|
||||
|
||||
%p Si vous souhaitez contacter le service, merci de le faire directement à l'aide de l'email en bas de page.
|
||||
|
||||
= round_button('Voir le dossier', dossier_url(@dossier), :primary)
|
||||
%p= t('.contact')
|
||||
= round_button(t('.access_file'), dossier_url(@dossier), :primary)
|
||||
|
||||
= render 'layouts/mailers/signature', service: @service
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
- content_for :procedure_logo do
|
||||
= render 'layouts/mailers/logo', url: @logo_url
|
||||
|
||||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
%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
|
|
@ -3,21 +3,12 @@
|
|||
|
||||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
%p
|
||||
Vous avez commencé à remplir un dossier pour la démarche
|
||||
= succeed '.' do
|
||||
%strong « #{@dossier.procedure.libelle} »
|
||||
|
||||
%p
|
||||
Vous pouvez
|
||||
%strong retrouver et compléter votre dossier
|
||||
en cliquant sur le bouton ci-dessous:
|
||||
|
||||
= round_button('Afficher votre dossier', dossier_url(@dossier), :primary)
|
||||
%p= t('.body', libelle_demarche: @dossier.procedure.libelle)
|
||||
%p= t('.link')
|
||||
= round_button(t('.access_file'), dossier_url(@dossier), :primary)
|
||||
|
||||
- if @dossier.procedure.auto_archive_on
|
||||
%p
|
||||
Vous pouvez déposer votre dossier jusqu’au #{procedure_auto_archive_datetime(@dossier.procedure)}.
|
||||
%p= t('.submit_before', before: procedure_auto_archive_datetime(@dossier.procedure))
|
||||
|
||||
= render 'layouts/mailers/signature'
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
- content_for :procedure_logo do
|
||||
= render 'layouts/mailers/logo', url: @logo_url
|
||||
|
||||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
%p
|
||||
Your File will be reexamined. All previous decisions are void.
|
||||
To see the File created on procedure
|
||||
%strong= @dossier.procedure.libelle
|
||||
, select the following link:
|
||||
= link_to dossier_url(@dossier), dossier_url(@dossier), target: '_blank', rel: 'noopener'
|
||||
|
||||
- if @dossier.procedure.service.present?
|
||||
%p
|
||||
In order to get more details about the decision to reexamin, please contact the following service:
|
||||
= mail_to @dossier.procedure.service.email, @dossier.procedure.service.email
|
||||
|
||||
= render 'layouts/mailers/signature'
|
||||
|
||||
- content_for :footer do
|
||||
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier
|
|
@ -4,15 +4,11 @@
|
|||
%p= t(:hello, scope: [:views, :shared, :greetings])
|
||||
|
||||
%p
|
||||
Votre dossier va être réexaminé, la précédente décision sur ce dossier est caduque.
|
||||
Vous pouvez retrouver le dossier que vous avez créé pour la démarche
|
||||
%strong= @dossier.procedure.libelle
|
||||
à l'adresse suivante :
|
||||
= t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle)
|
||||
= link_to dossier_url(@dossier), dossier_url(@dossier), target: '_blank', rel: 'noopener'
|
||||
- if @dossier.procedure.service.present?
|
||||
%p
|
||||
Pour obtenir le détail de cette modification de la décision, vous pouvez contacter par
|
||||
email:
|
||||
= t('.contact')
|
||||
= mail_to @dossier.procedure.service.email, @dossier.procedure.service.email
|
||||
|
||||
= render 'layouts/mailers/signature'
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_brouillon_not_submitted:
|
||||
subject: "Attention : votre dossier nº %{dossier_id} n’est pas déposé"
|
|
@ -0,0 +1,4 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_groupe_instructeur_changed:
|
||||
subject: Le dossier nº %{dossier_id} a changé de groupe instructeur
|
13
config/locales/views/dossier_mailer/notify_new_answer/en.yml
Normal file
13
config/locales/views/dossier_mailer/notify_new_answer/en.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_new_answer:
|
||||
subject: New message on your file nº %{dossier_id} « %{libelle_demarche} »
|
||||
body_html: |
|
||||
You received <b>a new message</b> from the service in charge of reviewing your file on « %{libelle_demarche} ».
|
||||
link: |
|
||||
To read the message and answer it, select the following link:
|
||||
body_draft_html: |
|
||||
You received <b>a new message</b> from the service in charge of reviewing the file you started a draft for on the procedure « %{libelle_demarche} ».
|
||||
contact: If you chose to contact the service, please use the email available below in the page.
|
||||
access_message: Read the message
|
||||
access_file: Open file
|
13
config/locales/views/dossier_mailer/notify_new_answer/fr.yml
Normal file
13
config/locales/views/dossier_mailer/notify_new_answer/fr.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_new_answer:
|
||||
subject: Nouveau message pour votre dossier nº %{dossier_id} « %{libelle_demarche} »
|
||||
body_html: |
|
||||
Vous avez reçu un <b>nouveau message</b> de la part du service en charge de votre dossier.
|
||||
link: |
|
||||
Pour consulter le message et y répondre, cliquez sur le bouton ci-dessous :
|
||||
body_draft_html: |
|
||||
Vous avez reçu un <b>nouveau message</b>du service pour lequel votre dossier est en brouillon pour la démarche « %{libelle_demarche} ».
|
||||
contact: Si vous souhaitez contacter le service, merci de le faire directement à l'aide de l'email en bas de page.
|
||||
access_message: Lire le message
|
||||
access_file: Voir le dossier
|
|
@ -1,5 +1,5 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_new_dossier_depose_to_instructeur:
|
||||
subject: Nouveau dossier déposé pour la démarche %{libelle_demarche}
|
||||
body: Un nouveau dossier a été déposé (n° %{dossier_id}) pour la démarche %{libelle_demarche}
|
||||
subject: Nouveau dossier déposé pour la démarche « %{libelle_demarche} »
|
||||
body: Un nouveau dossier a été déposé (n° %{dossier_id}) pour la démarche « %{libelle_demarche} »
|
||||
|
|
10
config/locales/views/dossier_mailer/notify_new_draft/en.yml
Normal file
10
config/locales/views/dossier_mailer/notify_new_draft/en.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
en:
|
||||
dossier_mailer:
|
||||
notify_new_draft:
|
||||
subject: Draft file created on procedure « %{libelle_demarche} »
|
||||
body_html: |
|
||||
You created a draft file on procedure <b>« %{libelle_demarche} »</b>.
|
||||
link_html: |
|
||||
You can access your file, to <b>review or complete</b>, by clicking on the following button:
|
||||
submit_before: Your file needs to be submitted before %{before}
|
||||
access_file: Open file
|
10
config/locales/views/dossier_mailer/notify_new_draft/fr.yml
Normal file
10
config/locales/views/dossier_mailer/notify_new_draft/fr.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_new_draft:
|
||||
subject: Retrouvez votre brouillon pour la démarche « %{libelle_demarche} »
|
||||
body_html: |
|
||||
Vous avez commencé à remplir un dossier pour la démarche <b>« %{libelle_demarche} »</b>.
|
||||
link_html: |
|
||||
Vous pouvez <b>retrouver et compléter votre dossier</b> en cliquant sur le bouton ci-dessous :
|
||||
submit_before: Vous pouvez déposer votre dossier jusqu’au %{before}.
|
||||
access_file: Afficher votre dossier
|
|
@ -0,0 +1,9 @@
|
|||
en:
|
||||
dossier_mailer:
|
||||
notify_revert_to_instruction:
|
||||
subject: Your file nº %{dossier_id} « %{libelle_demarche} » will be reexamined
|
||||
body_html: |
|
||||
Your file nº %{dossier_id} will be reexamined. All previous decisions are void.
|
||||
To see the file created on procedure <b>« %{libelle_demarche} »</b>, select the following link:
|
||||
contact: |
|
||||
In order to get more details about the decision to reexamin, please contact the following service:
|
|
@ -0,0 +1,9 @@
|
|||
fr:
|
||||
dossier_mailer:
|
||||
notify_revert_to_instruction:
|
||||
subject: Votre dossier nº %{dossier_id} sur la démarche « %{libelle_demarche} » est en train d’être réexaminé
|
||||
body_html: |
|
||||
Votre dossier va être réexaminé, la précédente décision sur ce dossier est caduque.
|
||||
Vous pouvez retrouver le dossier que vous avez créé pour la démarche <b>« %{libelle_demarche} »</b> à l'adresse suivante :
|
||||
contact: |
|
||||
Pour obtenir le détail de cette modification de la décision, vous pouvez contacter par email :
|
5
db/migrate/20210826161956_add_locale_to_users.rb
Normal file
5
db/migrate/20210826161956_add_locale_to_users.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class AddLocaleToUsers < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :users, :locale, :string
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_08_18_083349) do
|
||||
ActiveRecord::Schema.define(version: 2021_08_26_161956) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -753,6 +753,7 @@ ActiveRecord::Schema.define(version: 2021_08_18_083349) do
|
|||
t.bigint "instructeur_id"
|
||||
t.bigint "administrateur_id"
|
||||
t.bigint "expert_id"
|
||||
t.string "locale"
|
||||
t.index ["administrateur_id"], name: "index_users_on_administrateur_id"
|
||||
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
|
|
|
@ -202,8 +202,8 @@ RSpec.describe DossierMailer, type: :mailer do
|
|||
|
||||
subject { described_class.notify_groupe_instructeur_changed(instructeur, dossier) }
|
||||
|
||||
it { expect(subject.subject).to eq("Un dossier a changé de groupe instructeur") }
|
||||
it { expect(subject.body).to include("n°#{dossier.id}") }
|
||||
it { expect(subject.subject).to eq("Le dossier nº #{dossier.id} a changé de groupe instructeur") }
|
||||
it { expect(subject.body).to include("n° #{dossier.id}") }
|
||||
it { expect(subject.body).to include(dossier.procedure.libelle) }
|
||||
it { expect(subject.body).to include("Suite à cette modification, vous ne suivez plus ce dossier.") }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue