mailers: extract more of the template to partials
This will allow to re-use these partials in other emails
This commit is contained in:
parent
45abb6ebc2
commit
5bbcd600fb
3 changed files with 42 additions and 40 deletions
5
app/views/layouts/mailers/_logo.html.haml
Normal file
5
app/views/layouts/mailers/_logo.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- if url.present?
|
||||
%table{ width: "100%", border: "0", cellspacing: "0", cellpadding: "0" }
|
||||
%tr
|
||||
%td{ align: "center" }
|
||||
= image_tag url, height: "150", style: "display:block; max-height: 150px; max-width: 150px;"
|
34
app/views/layouts/mailers/_service_footer.html.haml
Normal file
34
app/views/layouts/mailers/_service_footer.html.haml
Normal file
|
@ -0,0 +1,34 @@
|
|||
%strong
|
||||
Merci de ne pas répondre à cet email.
|
||||
- if dossier.present? && dossier.messagerie_available?
|
||||
Pour vous adresser à votre administration, passez directement par la
|
||||
= succeed '.' do
|
||||
= link_to 'messagerie du dossier', messagerie_dossier_url(dossier), 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
|
||||
- if dossier.present? && dossier.messagerie_available?
|
||||
= link_to 'Par la messagerie', messagerie_dossier_url(dossier), target: '_blank', rel: 'noopener'
|
||||
- else
|
||||
Par email :
|
||||
= link_to service.email, "mailto:#{service.email}"
|
||||
%br
|
||||
Par téléphone :
|
||||
= link_to service.telephone, "tel:#{service.telephone}"
|
||||
%br
|
||||
Horaires : #{ formatted_horaires(service.horaires) }
|
||||
|
|
@ -1,44 +1,7 @@
|
|||
- if @logo_url.present?
|
||||
- content_for :procedure_logo do
|
||||
%table{ width: "100%", border: "0", cellspacing: "0", cellpadding: "0" }
|
||||
%tr
|
||||
%td{ align: "center" }
|
||||
= image_tag @logo_url, height: "150", style: "display:block; max-height: 150px; max-width: 150px;"
|
||||
= render 'layouts/mailers/logo', url: @logo_url
|
||||
|
||||
- content_for :footer do
|
||||
%strong
|
||||
Merci de ne pas répondre à cet email.
|
||||
- if @dossier.present? && @dossier.messagerie_available?
|
||||
Pour vous adresser à votre administration, passez directement par la
|
||||
= succeed '.' do
|
||||
= link_to 'messagerie du dossier', messagerie_dossier_url(@dossier), 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
|
||||
- if @dossier.present? && @dossier.messagerie_available?
|
||||
= link_to 'Par la messagerie', messagerie_dossier_url(@dossier), target: '_blank', rel: 'noopener'
|
||||
- else
|
||||
Par email :
|
||||
= link_to @service.email, "mailto:#{@service.email}"
|
||||
%br
|
||||
Par téléphone :
|
||||
= link_to @service.telephone, "tel:#{@service.telephone}"
|
||||
%br
|
||||
Horaires : #{ formatted_horaires(@service.horaires) }
|
||||
|
||||
= render 'layouts/mailers/service_footer', service: @service, dossier: @dossier
|
||||
|
||||
= render template: 'layouts/mailers/notifications_layout'
|
||||
|
|
Loading…
Reference in a new issue