[Fix #3064] If procedure has logo, then display it in emails

This commit is contained in:
Mathieu Magnin 2019-03-14 16:01:30 +01:00
parent b3970a5e6f
commit 7e551a9d8d
3 changed files with 13 additions and 1 deletions

View file

@ -38,6 +38,11 @@ class NotificationMailer < ApplicationMailer
@dossier = dossier
if dossier.procedure.logo?
@logo_filename = dossier.procedure.logo.filename
attachments.inline[@logo_filename] = dossier.procedure.logo.read
end
mail(subject: subject, to: email) do |format|
# rubocop:disable Rails/OutputSafety
format.html { render(html: body.html_safe, layout: 'mailers/notification') }