[Fix #3064] If procedure has logo, then display it in emails
This commit is contained in:
parent
b3970a5e6f
commit
7e551a9d8d
3 changed files with 13 additions and 1 deletions
|
@ -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') }
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
- if @logo_filename.present?
|
||||
- content_for :procedure_logo do
|
||||
%table{ width: "100%", border: "0", cellspacing: "0", cellpadding: "0" }
|
||||
%tr
|
||||
%td{ align: "center" }
|
||||
= image_tag attachments[@logo_filename].url, style: "height: 150px;"
|
||||
|
||||
- content_for :footer do
|
||||
%strong
|
||||
Merci de ne pas répondre à cet email. Pour vous adresser à votre administration, passez directement par votre
|
||||
|
|
|
@ -86,10 +86,10 @@
|
|||
<div class="mj-column-per-100 outlook-group-fix" style="vertical-align:top;display:inline-block;direction:ltr;font-size:13px;text-align:left;width:100%;">
|
||||
<table role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
|
||||
<tbody>
|
||||
<%= yield(:procedure_logo) %>
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;font-size:0px;padding:0px 25px 0px 25px;padding-top:0px;padding-bottom:0px;" align="left">
|
||||
<div class="" style="cursor:auto;color:#55575d;font-family:Helvetica, Arial, sans-serif;font-size:13px;line-height:22px;text-align:left;">
|
||||
<h1 style="font-size: 30px; text-align: center; font-weight: 300; max-width: 300px; margin: 30px auto 40px; line-height: 1.2;"><%= yield(:title) %></h1>
|
||||
<%= yield %>
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in a new issue