ajout du JDMA au mail de depot de dossier (avec nb_source=email)
This commit is contained in:
parent
a9b56459c8
commit
d7a19bd421
3 changed files with 20 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
class NotificationMailer < ApplicationMailer
|
||||
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_jdma, only: :send_notification
|
||||
|
||||
helper ServiceHelper
|
||||
helper MailerHelper
|
||||
|
@ -88,6 +89,12 @@ class NotificationMailer < ApplicationMailer
|
|||
@services_publics_plus_url = ENV['SERVICES_PUBLICS_PLUS_URL'].presence
|
||||
end
|
||||
|
||||
def set_jdma
|
||||
return unless params[:state] == Dossier.states.fetch(:en_construction)
|
||||
|
||||
@jdma_html = @dossier.procedure.monavis_embed.presence
|
||||
end
|
||||
|
||||
def set_dossier
|
||||
@dossier = params[:dossier]
|
||||
configure_defaults_for_user(@dossier.user)
|
||||
|
|
10
app/views/layouts/mailers/_jdma.html.haml
Normal file
10
app/views/layouts/mailers/_jdma.html.haml
Normal 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)
|
|
@ -9,5 +9,8 @@
|
|||
- if @services_publics_plus_url.present?
|
||||
= render 'layouts/mailers/services_publics_plus'
|
||||
|
||||
- if @jdma_html.present?
|
||||
= render 'layouts/mailers/jdma'
|
||||
|
||||
- content_for :footer do
|
||||
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier
|
||||
|
|
Loading…
Reference in a new issue