Merge pull request #3780 from betagouv/fix-missing-logo
Fix when missing logo on remote storage crash email sending
This commit is contained in:
commit
62082f585a
1 changed files with 8 additions and 3 deletions
|
@ -39,9 +39,14 @@ class NotificationMailer < ApplicationMailer
|
|||
create_commentaire_for_notification(dossier, subject, body)
|
||||
|
||||
if dossier.procedure.logo?
|
||||
logo_filename = dossier.procedure.logo.filename
|
||||
attachments.inline[logo_filename] = dossier.procedure.logo.read
|
||||
@logo_url = attachments[logo_filename].url
|
||||
begin
|
||||
logo_filename = dossier.procedure.logo.filename
|
||||
attachments.inline[logo_filename] = dossier.procedure.logo.read
|
||||
@logo_url = attachments[logo_filename].url
|
||||
rescue StandardError => e
|
||||
# A problem occured when reading logo, maybe the logo is missing and we should clean the procedure to remove logo reference ?
|
||||
Raven.capture_exception(e)
|
||||
end
|
||||
end
|
||||
|
||||
@dossier = dossier
|
||||
|
|
Loading…
Reference in a new issue