I'm new to email template designs and I'm wondering why this is happening to my email template. The first screen shot is what I expect and the others are what is rendered in gmail, yahoo and outlook respectively. My concern is why is the logo not being aligned to the right as expected. I've also attached the corresponding code that shows the logo.
<tr>
<td align="center" valign="top">
<!-- CENTERING TABLE // -->
<!--
The centering table keeps the content
tables centered in the emailBody table,
in case its width is set to 100%.
-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="color:#ffffff;" bgcolor="#E1E1E1">
<tr>
<td align="center" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<!--
The flexible container has a set width
that gets overridden by the media query.
Most content tables within can then be
given 100% widths.
-->
<table border="0" cellpadding="0" cellspacing="0" width="600" class="flexibleContainer">
<tr>
<td align="center" valign="top" width="600" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<!--
The content table is the first element
that's entirely separate from the structural
framework of the email.
-->
<table border="0" cellpadding="30" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" class="textContent">
<img align="right" alt="accesbank-logo" src="http://oi65.tinypic.com/euel9v.jpg" /><br /><br />
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
You have a lot of align center on the td's which need to be align right as the logo is in a table that is supposed to be aligned right.
I have added an extra table and made it the same size as the logo and aligned it right.
<tr>
<td align="right" valign="top">
<!-- CENTERING TABLE // -->
<!--
The centering table keeps the content
tables centered in the emailBody table,
in case its width is set to 100%.
-->
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="color:#ffffff;" bgcolor="#E1E1E1">
<tr>
<td align="right" valign="top">
<!-- FLEXIBLE CONTAINER // -->
<!--
The flexible container has a set width
that gets overridden by the media query.
Most content tables within can then be
given 100% widths.
-->
<table border="0" cellpadding="0" cellspacing="0" width="600" class="flexibleContainer">
<tr>
<td align="right" valign="top" width="600" class="flexibleContainerCell">
<!-- CONTENT TABLE // -->
<!--
The content table is the first element
that's entirely separate from the structural
framework of the email.
-->
<table border="0" cellpadding="30" cellspacing="0" width="100%">
<tr>
<td align="right" valign="top" class="textContent">
<table width="152" border="0" align="right" cellpadding="0" cellspacing="0" style="width:100%; max-width: 152px;">
<tbody>
<tr>
<td align="right"><img alt="accesbank-logo" src="http://oi65.tinypic.com/euel9v.jpg" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
<!-- // FLEXIBLE CONTAINER -->
</td>
</tr>
</table>
<!-- // CENTERING TABLE -->
</td>
</tr>
Let me know if this fixes it. If this doesn't fix the issue then we will need more code to see if there is any conflicting class or ID that is causing teh template to go eider than the design.
Is this part of a hybrid or responsive email?
Cheers
Related
I have two tables aligned left at 30% each so that when it goes responsive the change to 100% and stack underneath each other.
Problem is as per the screenshot below the second one has a gap at the top and i have no idea why?
My snippet of code is here
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" class="fullWidth" style="padding-left:30px;padding-right:30px;">
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="30%" class="tableFullWidth">
<tr>
<td valign="top" class="topTen"> <p><span>1</span> FIRST AND LAST NAME</p>
<hr>
<p><span>2</span> FIRST AND LAST NAME</p>
<hr>
<p><span>3</span> FIRST AND LAST NAME</p>
<hr>
<p><span>4</span> FIRST AND LAST NAME</p>
<hr>
<p><span>5</span> FIRST AND LAST NAME</p>
<hr>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="30%" class="tableFullWidth">
<tr>
<td valign="top" class="topTen">
<p><span>6</span> FIRST AND LAST NAME</p>
<hr>
<p><span>7</span> FIRST AND LAST NAME</p>
<hr>
<p><span>8</span> FIRST AND LAST NAME</p>
<hr>
<p><span>9</span> FIRST AND LAST NAME</p>
<hr>
<p><span>10</span> FIRST AND LAST NAME</p>
<hr>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
Outlook 2010 - Screenshot
Doesn't look like the same code from the screenshots, background colors are missing and fonts as well. Either way I think you need a ghost column between the tables to align, try the code below:
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="top" class="fullWidth" style="padding-left:30px;padding-right:30px;">
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="30%" class="tableFullWidth">
<tr>
<td valign="top" class="topTen"> <p><span>6</span> FIRST AND LAST NAME</p>
<hr>
<p><span>7</span> FIRST AND LAST NAME</p>
<hr>
<p><span>8</span> FIRST AND LAST NAME</p>
<hr>
<p><span>9</span> FIRST AND LAST NAME</p>
<hr>
<p><span>10</span> FIRST AND LAST NAME</p>
<hr>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
<!--[if (gte mso 9)|(IE)]>
</td><td align="left" valign="top" width="50%">
<![endif]-->
<!-- CONTENT TABLE // -->
<table align="left" border="0" cellpadding="0" cellspacing="0" width="30%" class="tableFullWidth">
<tr>
<td valign="top" class="topTen">
<p><span>6</span> FIRST AND LAST NAME</p>
<hr>
<p><span>7</span> FIRST AND LAST NAME</p>
<hr>
<p><span>8</span> FIRST AND LAST NAME</p>
<hr>
<p><span>9</span> FIRST AND LAST NAME</p>
<hr>
<p><span>10</span> FIRST AND LAST NAME</p>
<hr>
</td>
</tr>
</table>
<!-- // CONTENT TABLE -->
</td>
</tr>
</table>
You can change the width of the ghost column if you need to. let me know how you go.
My media queries are not being recognized by Gmail for mobile.
Does anybody how can this be fixed? I'd like my cells to stack, it all works fine on Mail iOS, Outlook iOS, but not Gmail ...
Thanks for your advice!
Gmail doesn't support media queries (or the <style> tag), so in order to have table cells stack on narrow widths you have to code a hybrid email.
These patterns by Fabio Carniero demonstrate this principle in action. I would strongly recommend looking at these scaffolds, as they achieve column stacking in mobile Gmail as well as other email clients that don't support media queries.
Here is an example of a 2-column layout that stacks without using media queries (adapted from Fabio's files):
<!-- // 2-COLUMN SCAFFOLD [CENTERING, FLUID] -->
<tr>
<td align="center" height="100%" valign="top" width="100%">
<!--[if mso]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="660">
<tr>
<td align="center" valign="top" width="660">
<![endif]-->
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:660px;">
<tr>
<td align="center" valign="top" style="font-size:0;">
<!--[if mso]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="660">
<tr>
<td align="left" valign="top" width="330">
<![endif]-->
<div style="display:inline-block; max-width:50%; min-width:240px; vertical-align:top; width:100%;">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:330px;">
<tr>
<td align="center" valign="top">
LEFT
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
<td align="left" valign="top" width="330">
<![endif]-->
<div style="display:inline-block; max-width:50%; min-width:240px; vertical-align:top; width:100%;">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:330px;">
<tr>
<td align="center" valign="top">
RIGHT
</td>
</tr>
</table>
</div>
<!--[if mso]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
<!--[if mso]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
<!-- 2-COLUMN SCAFFOLD [CENTERING, FLUID] // -->
I have a question regarding the magento order emails.
I have created my own order template by loading the default template and modifying it. When i take a look via the 'preview template' button on there, the email appears without order information (of course) but with every styling etc.
However when my customer gets the email it is pure text with no styling at all.
What could i have been doing wrong
Idk if it helps but here is my email template:
{{template config_path="design/email/header"}}
{{inlinecss file="email-inline.css"}}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style='background: #fff' class="email-heading">
<h1 style='color: #68883e;'>Thank you for your order</h1>
<p>Your order is being process right now</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="order-details">
<h3 style='display: inline; float: left'>Your order <span class="no-link">#{{var order.increment_id}}</span></h3>
<p style='display: inline; float: right'>Placed on {{var order.getCreatedAtFormated('long')}}</p>
</td>
</tr>
<tr class="order-information">
<td>
{{if order.getEmailCustomerNote()}}
<table cellspacing="0" cellpadding="0" class="message-container">
<tr>
<td>{{var order.getEmailCustomerNote()}}</td>
</tr>
</table>
{{/if}}
{{layout handle="sales_email_order_items" order=$order}}
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="address-details">
<h6>Bill to:</h6>
<p><span class="no-link">{{var order.getBillingAddress().format('html')}}</span></p>
</td>
<td class="address-details">
<h6>Client:</h6>
<p><span class="no-link">{{var order.getclientfirstname().format('html')}}</span></p>
</td>
</tr>
<tr>
{{depend order.getIsNotVirtual()}}
<td class="method-info">
<h6>Shipping method:</h6>
<p>{{var order.shipping_description}}</p>
</td>
{{/depend}}
<td class="method-info">
<h6>Payment method:</h6>
{{var payment_html}}
</td>
</tr>
</table>
</td>
</tr>
</table><!-- asd-->
{{layout handle="sales_email_order_items" order=$order}}
{{template config_path="design/email/footer"}}
You shouldn't use the CSS classes to stylize the templates.
Also, you shouldn't use the file with the styles info, that is located anywhere else, as they are not supported by the majority of the email services.
Instead, you can directly use the attribute tags (to implement the stylazation) or use the styles right in the email code (using the tag <style>)
And here is the list of tags you can use:
https://www.campaignmonitor.com/css/
This is the code that is broken in outlook 2013 and 2010 works fine in 2003 and everything else. I am wondering what might be causing the issue. The page is just white and I cant find any of the email template in litmus. If anyone could help that would be great.
<!-- Wrapper 2 (Header) -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" valign="top" bgcolor="#ffffff">
<!-- 1px Height Border -->
<table class="fullWidth" width="740" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" height="1" bgcolor="#dedede"></td>
</tr>
</table>
<!-- Mobile Wrapper -->
<table width="100%" height="300" class="fullWidth" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" bgcolor="f6f6f6" background="beachBg.png" style="background-size: 100%; background-position-y: -100px;">
<a href="http://www.something.com">
<div>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:740px;height:300px;">
<v:fill type="tile" src="beachBg.png" color="#000000" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<table table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="scaleForMobile" height="300">
<tr align="right" class="socialNav">
<td width="100%">
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="rss" src="rss.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="vimeo" src="vimeo.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="50" valign="top">
<img alt="instagram" src="instagram.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="tumblr" src="tumblr.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="youtube" src="youtube.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="facebook" src="facebook.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="linkedin" src="linkedin.png"/>
</td>
</tr>
</tbody></table>
</tr>
<tr class="beachLogo">
<td style="width:740;" ><img style="margin-left:80px;" src="beachLogo.png"></td>
<td width="400"></td>
</tr>
</table>
<div>
</div>
</div>
</td>
</tr>
</table><!-- End Header -->
</td>
</tr>
</table><!-- End Mobile Wrapper -->
<!-- Space -->
<table bgcolor="ffffff" width="740" border="0" cellpadding="0" cellspacing="0" align="center" class="mobileCenter">
<tr>
<td width="740" height="0">
</td>
</tr>
</table>
</td>
</tr>
</table><!-- End Wrapper 2 -->
A couple of syntax issues I'm seeing.
<a href="http://www.something.com"> is missing a closing tag.
You probably shouldn't be wrapping everything in just 1 <a> tag like that.
The </tr> before <tr class="beachLogo"> is missing a </td>
Fix those issues and see if you get better results in Outlook.
I'm designing a responsive email, and I have two tables in one <td>. The second table is not top aligned in Outlook 2007 and 2010:
Both tables inside a td have a pixel width but rest of the tables inside these two tables have width=%.
I tried align left and right, as well as style="mso-table-lspace:0;mso-table-rspace:0;" but it's still not working.
I ran into the same problem. I suspect it is due to Outlook using Word to render HTML and Word is getting confused and barfing up a page break.
I recommend placing each of the tables inside cells of a parent table. Then apply your style to the cells of the parent table. Note that "float" is generally bad to use in HTML for email, but since it's in a media query means it's safe to use.
CSS:
#media only screen and (max-width: 500px) {
.floatLeftResponse{
width:100% !important;
float:left;
}
}
HTML:
<table width="800" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="50%" valign="top" class="floatLeftResponse">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td> <!---bla bla bla this is your left column content-->
</td>
</tr>
</table>
</td>
<td width="50%" valign="top" class="floatLeftResponse">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td> <!---bla bla bla this is your right column content-->
</td>
</tr>
</table>
</td>
</tr>
</table>