diff --git a/app/mailers/dossier_mailer.rb b/app/mailers/dossier_mailer.rb index 88d469252ba..d9081708ee6 100644 --- a/app/mailers/dossier_mailer.rb +++ b/app/mailers/dossier_mailer.rb @@ -12,7 +12,7 @@ def notify_new_draft @dossier = params[:dossier] I18n.with_locale(@dossier.user_locale) do @service = @dossier.procedure.service - @logo_url = @dossier.procedure.email_logo_url + @logo_url = procedure_logo_url(@dossier.procedure) @subject = default_i18n_subject(libelle_demarche: @dossier.procedure.libelle) mail(to: @dossier.user_email_for(:notification), subject: @subject) do |format| @@ -27,7 +27,7 @@ def notify_new_answer I18n.with_locale(dossier.user_locale) do @dossier = dossier @service = dossier.procedure.service - @logo_url = @dossier.procedure.email_logo_url + @logo_url = procedure_logo_url(@dossier.procedure) @body = commentaire.body @subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle) @@ -52,7 +52,7 @@ def notify_pending_correction I18n.with_locale(dossier.user_locale) do @dossier = dossier @service = dossier.procedure.service - @logo_url = @dossier.procedure.email_logo_url + @logo_url = procedure_logo_url(@dossier.procedure) @correction = commentaire.dossier_correction @subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle) @@ -85,7 +85,7 @@ def notify_revert_to_instruction(dossier) I18n.with_locale(dossier.user_locale) do @dossier = dossier @service = dossier.procedure.service - @logo_url = @dossier.procedure.email_logo_url + @logo_url = procedure_logo_url(@dossier.procedure) @subject = default_i18n_subject(dossier_id: dossier.id, libelle_demarche: dossier.procedure.libelle) mail(to: dossier.user_email_for(:notification), subject: @subject) do |format| diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 0a66929d26d..23b9a605711 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -17,7 +17,7 @@ class NotificationMailer < ApplicationMailer def send_notification @service = @dossier.procedure.service - @logo_url = @dossier.procedure.email_logo_url + @logo_url = procedure_logo_url(@dossier.procedure) attachments[@attachment[:filename]] = @attachment[:content] if @attachment.present? I18n.with_locale(@dossier.user_locale) do mail(subject: @subject, to: @email, template_name: 'send_notification') diff --git a/app/models/procedure.rb b/app/models/procedure.rb index adbf0033dde..3436e11fef8 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -635,14 +635,6 @@ def missing_steps result end - def email_logo_url - if logo.attached? - logo.variant(:email).processed.blob.url(expires_in: 1.year) - else - ActionController::Base.helpers.image_url(PROCEDURE_DEFAULT_LOGO_SRC) - end - end - def logo_url if logo.attached? Rails.application.routes.url_helpers.url_for(logo)