chore(mailer): services publics + only for Termine "states"

This commit is contained in:
Colin Darie 2023-02-07 17:27:25 +01:00
parent 82ad6346cc
commit d78c75620a
3 changed files with 9 additions and 1 deletions

View file

@ -9,6 +9,7 @@ class NotificationMailer < ApplicationMailer
include ActionView::Helpers::SanitizeHelper
before_action :set_dossier
before_action :set_services_publics_plus, only: :send_notification
after_action :create_commentaire_for_notification
helper ServiceHelper
@ -50,6 +51,12 @@ class NotificationMailer < ApplicationMailer
private
def set_services_publics_plus
return unless Dossier::TERMINE.include?(params[:state])
@with_services_publics_plus = true
end
def set_dossier
@dossier = params[:dossier]

View file

@ -6,7 +6,8 @@
- if @actions.present?
= render 'notification_mailer/actions', actions: @actions, dossier: @dossier
= render 'layouts/mailers/service_plus'
- if @with_services_publics_plus
= render 'layouts/mailers/services_publics_plus'
- content_for :footer do
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier