ajout du JDMA au mail de depot de dossier (avec nb_source=email)

This commit is contained in:
Benoit Queyron 2024-06-07 18:20:28 +02:00
parent a9b56459c8
commit d7a19bd421
3 changed files with 20 additions and 0 deletions

View file

@ -8,6 +8,7 @@
class NotificationMailer < ApplicationMailer class NotificationMailer < ApplicationMailer
before_action :set_dossier, except: [:send_notification_for_tiers, :send_accuse_lecture_notification] before_action :set_dossier, except: [:send_notification_for_tiers, :send_accuse_lecture_notification]
before_action :set_services_publics_plus, only: :send_notification before_action :set_services_publics_plus, only: :send_notification
before_action :set_jdma, only: :send_notification
helper ServiceHelper helper ServiceHelper
helper MailerHelper helper MailerHelper
@ -88,6 +89,12 @@ class NotificationMailer < ApplicationMailer
@services_publics_plus_url = ENV['SERVICES_PUBLICS_PLUS_URL'].presence @services_publics_plus_url = ENV['SERVICES_PUBLICS_PLUS_URL'].presence
end end
def set_jdma
return unless params[:state] == Dossier.states.fetch(:en_construction)
@jdma_html = @dossier.procedure.monavis_embed.presence
end
def set_dossier def set_dossier
@dossier = params[:dossier] @dossier = params[:dossier]
configure_defaults_for_user(@dossier.user) configure_defaults_for_user(@dossier.user)

View file

@ -0,0 +1,10 @@
= vertical_margin(50)
%div{ align: "center" }
%p
%strong Aidez-nous à améliorer ce service !
%br
Donnez-nous votre avis, cela ne prend que 2 minutes.
!= @jdma_html.gsub('nd_source=button', 'nd_source=email').gsub('<a ', '<a target="_blank" rel="noopener noreferrer" ')
= vertical_margin(20)

View file

@ -9,5 +9,8 @@
- if @services_publics_plus_url.present? - if @services_publics_plus_url.present?
= render 'layouts/mailers/services_publics_plus' = render 'layouts/mailers/services_publics_plus'
- if @jdma_html.present?
= render 'layouts/mailers/jdma'
- content_for :footer do - content_for :footer do
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier = render 'layouts/mailers/service_footer', service: @service, dossier: @dossier