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:
@@ -38,7 +38,17 @@
|
||||
<%= t("admin.newsletters.show.body_help_text") %>
|
||||
</p>
|
||||
<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>
|
||||
|
||||
|
||||
13
app/views/layouts/_mailer_footer.html.erb
Normal file
13
app/views/layouts/_mailer_footer.html.erb
Normal 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>
|
||||
15
app/views/layouts/_mailer_header.html.erb
Normal file
15
app/views/layouts/_mailer_header.html.erb
Normal 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>
|
||||
@@ -7,38 +7,16 @@
|
||||
</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;">
|
||||
|
||||
<%= render "layouts/mailer_header" %>
|
||||
|
||||
<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>
|
||||
<tbody>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<%= render "layouts/mailer_footer" %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user