Moves mailer header and footer to partials

This prevent use the entire HTML layout, an HTML inside another HTML
without using an iframe create some validation errors and break layout
details
This commit is contained in:
decabeza
2018-04-02 17:37:43 +02:00
parent be8bcf9269
commit b2015312d8
4 changed files with 46 additions and 30 deletions

View File

@@ -38,7 +38,17 @@
<%= t("admin.newsletters.show.body_help_text") %> <%= t("admin.newsletters.show.body_help_text") %>
</p> </p>
<div class="newsletter-body-content"> <div class="newsletter-body-content">
<%= render file: "app/views/mailer/newsletter.html.erb", layout: '/app/views/layouts/mailer.html.erb' %> <%= render file: "app/views/layouts/_mailer_header.html.erb" %>
<table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;">
<tbody>
<tr>
<%= render file: "app/views/mailer/newsletter.html.erb" %>
</tr>
</tbody>
</table>
<%= render file: "app/views/layouts/_mailer_footer.html.erb" %>
</div> </div>
</div> </div>

View File

@@ -0,0 +1,13 @@
<table cellpadding="0" cellspacing="0" border="0" style="margin: 0 auto; max-width: 700px; width:100%; margin-bottom: 40px; padding: 0 20px;">
<tbody>
<tr>
<td style="text-align: center; border-top: 1px solid #dadfe1; padding-top: 20px;">
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; margin: 0;padding: 0;line-height: 1.5em;color: #797f7f; font-size: 12px;">
<%= setting['org_name'] %></p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; margin: 0;padding: 0;line-height: 1.5em;color: #222; font-size: 10px; margin-top: 12px;">
<%= t('mailers.no_reply') %></p>
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,15 @@
<table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
<tr>
<td style="border-bottom: 1px solid #dadfe1; padding: 20px 0;">
<a href="#" target="_blank">
<%= image_tag('logo_email.png', style: "border: 0; display: block; width: 100%;max-width: 370px", alt: setting['org_name']) %>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>

View File

@@ -7,38 +7,16 @@
</head> </head>
<body style="background: #fff; font-family:font-family: 'Open Sans','Helvetica Neue',arial,sans-serif !important; margin: 0 10px; padding: 0; text-align: left;"> <body style="background: #fff; font-family:font-family: 'Open Sans','Helvetica Neue',arial,sans-serif !important; margin: 0 10px; padding: 0; text-align: left;">
<%= render "layouts/mailer_header" %>
<table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;"> <table cellpadding="0" cellspacing="0" border="0" style="background: #fff; margin: 0 auto; max-width: 700px; width:100%;">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
<tr>
<td style="border-bottom: 1px solid #dadfe1; padding: 20px 0;">
<a href="#" target="_blank">
<%= image_tag('logo_email.png', style: "border: 0; display: block; width: 100%;max-width: 370px", alt: setting['org_name']) %>
</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<%= yield %>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0" style="margin: 0 auto; max-width: 700px; width:100%; margin-bottom: 40px; padding: 0 20px;">
<tbody> <tbody>
<tr> <tr>
<td style="text-align: center; border-top: 1px solid #dadfe1; padding-top: 20px;"> <%= yield %>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; margin: 0;padding: 0;line-height: 1.5em;color: #797f7f; font-size: 12px;"> </tr>
<%= setting['org_name'] %></p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; margin: 0;padding: 0;line-height: 1.5em;color: #222; font-size: 10px; margin-top: 12px;">
<%= t('mailers.no_reply') %></p>
</td>
</tr>
</tbody> </tbody>
</table> </table>
<%= render "layouts/mailer_footer" %>
</body> </body>
</html> </html>