[#2772] Notify users that their dossier was restored
This commit is contained in:
parent
3283cb1ae7
commit
1e4ccda14c
3 changed files with 26 additions and 1 deletions
|
@ -21,4 +21,12 @@ class DossierMailer < ApplicationMailer
|
|||
|
||||
mail(to: dossier.user.email, subject: subject)
|
||||
end
|
||||
|
||||
def notify_undelete_to_user(dossier)
|
||||
@dossier = dossier
|
||||
@dossier_kind = dossier.brouillon? ? 'brouillon' : 'dossier'
|
||||
@subject = "Votre #{@dossier_kind} n° #{@dossier.id} est à nouveau accessible"
|
||||
|
||||
mail(to: dossier.user.email, subject: @subject)
|
||||
end
|
||||
end
|
||||
|
|
15
app/views/dossier_mailer/notify_undelete_to_user.html.haml
Normal file
15
app/views/dossier_mailer/notify_undelete_to_user.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
|||
- content_for(:title, @subject)
|
||||
|
||||
%h1 Bonjour,
|
||||
|
||||
%p
|
||||
En raison d’un incident, votre
|
||||
= link_to("#{@dossier_kind} n° #{@dossier.id}", dossier_url(@dossier))
|
||||
sur la procédure « #{@dossier.procedure.libelle} » a été inaccessible pendant quelques jours.
|
||||
|
||||
L’accès est à présent à nouveau possible. Nous vous présentons nos excuses pour toute gène occasionnée.
|
||||
%p
|
||||
Bonne journée,
|
||||
|
||||
%p
|
||||
L'équipe demarches-simplifiees.fr
|
|
@ -181,7 +181,9 @@ namespace :after_party do
|
|||
source_procedure = Procedure.unscoped.find(deleted_procedure_id)
|
||||
destination_procedure = Procedure.find(new_procedure_id)
|
||||
|
||||
migrator = Tasks::DossierProcedureMigrator.new(source_procedure, destination_procedure, champ_mapping, champ_private_mapping, pj_mapping)
|
||||
migrator = Tasks::DossierProcedureMigrator.new(source_procedure, destination_procedure, champ_mapping, champ_private_mapping, pj_mapping) do |dossier|
|
||||
DossierMailer.notify_undelete_to_user(dossier).deliver_later
|
||||
end
|
||||
migrator.check_consistency
|
||||
migrator.migrate_dossiers
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue