From c5fa25ee78f6f7f208389ec4f35ecb09a9f10891 Mon Sep 17 00:00:00 2001 From: Benoit Queyron Date: Tue, 11 Jun 2024 17:45:51 +0200 Subject: [PATCH] unless to if condition --- app/mailers/notification_mailer.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 9b0d94493..c319df7dd 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -90,9 +90,11 @@ class NotificationMailer < ApplicationMailer end def set_jdma - return unless params[:state] == Dossier.states.fetch(:en_construction) - - @jdma_html = @dossier.procedure.monavis_embed_html_source("email").presence + if params[:state] == Dossier.states.fetch(:en_construction) && @dossier.procedure.monavis_embed + @jdma_html = @dossier.procedure.monavis_embed_html_source("email") + else + return + end end def set_dossier