[Fix #3064] Add service footer on notification emails
This commit is contained in:
parent
60d66f0422
commit
9c6c11027c
3 changed files with 30 additions and 4 deletions
|
@ -4,9 +4,10 @@ module NewAdministrateur
|
|||
|
||||
def preview
|
||||
@procedure = procedure
|
||||
@dossier = Dossier.new(id: 0)
|
||||
mail_template = find_mail_template_by_slug(params[:id])
|
||||
@logo_url = procedure.logo.url
|
||||
@service = procedure.service
|
||||
|
||||
mail_template = find_mail_template_by_slug(params[:id])
|
||||
|
||||
render(html: sanitize(mail_template.body), layout: 'mailers/notification')
|
||||
end
|
||||
|
|
|
@ -36,14 +36,15 @@ class NotificationMailer < ApplicationMailer
|
|||
|
||||
create_commentaire_for_notification(dossier, subject, body)
|
||||
|
||||
@dossier = dossier
|
||||
|
||||
if dossier.procedure.logo?
|
||||
logo_filename = dossier.procedure.logo.filename
|
||||
attachments.inline[logo_filename] = dossier.procedure.logo.read
|
||||
@logo_url = attachments[logo_filename].url
|
||||
end
|
||||
|
||||
@dossier = dossier
|
||||
@service = dossier.procedure.service
|
||||
|
||||
mail(subject: subject, to: email) do |format|
|
||||
# rubocop:disable Rails/OutputSafety
|
||||
format.html { render(html: body.html_safe, layout: 'mailers/notification') }
|
||||
|
|
|
@ -15,4 +15,28 @@
|
|||
= succeed '.' do
|
||||
= link_to 'messagerie', messagerie_url, target: '_blank', rel: 'noopener'
|
||||
|
||||
- if @service.present?
|
||||
%table{ width: "100%", border: "0", cellspacing: "0", cellpadding: "0", style: "cursor:auto;color:#55575d;font-family:Helvetica, Arial, sans-serif;font-size:11px;line-height:22px;text-align:left;" }
|
||||
%tr
|
||||
%td{ width: "50%", valign: "top" }
|
||||
%p
|
||||
%strong Cette démarche est gérée par :
|
||||
%br
|
||||
= @service.nom
|
||||
%br
|
||||
= @service.organisme
|
||||
%br
|
||||
= @service.adresse
|
||||
%td{ width: "50%", valign: "top" }
|
||||
%p
|
||||
%strong Poser une question sur votre dossier :
|
||||
%br
|
||||
= link_to 'Par la messagerie', messagerie_url, target: '_blank', rel: 'noopener'
|
||||
%br
|
||||
Par téléphone :
|
||||
= link_to @service.telephone, "tel:#{@service.telephone}"
|
||||
%br
|
||||
Horaires : #{ formatted_horaires(@service.horaires) }
|
||||
|
||||
|
||||
= render template: 'layouts/mailers/notifications_layout'
|
||||
|
|
Loading…
Reference in a new issue