I created a newsletter with the module "Simplenews". I also created a custom template for my newsletter :
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
<tr>
<td align="center">
<a href="<?php print $node_url; ?>" target="_blank">
<table class="deviceWidth" border="0" cellpadding="0" cellspacing="0" width="580" align="center" style="border: 1px solid #ddd;">
<tr>
<td>
<table class="deviceWidth" border="0" cellpadding="0" cellspacing="0" width="280" align="left">
<tr>
<td align="center">
<?php print render($content['field_image']); ?>
</td>
</tr>
</table>
<table class="deviceWidth" border="0" cellpadding="0" cellspacing="0" width="280" align="right">
<tr>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #2b9900; font-size: 16px; font-weight: bold; text-decoration: none;">
<?php print render($content['title']); ?>
</td>
</tr>
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
<tr>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #313a42; line-height: 20px; text-align: justify;">
<?php print render($content['body']); ?>
</td>
</tr>
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
<tr>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 20px; font-weight: bold; text-decoration: none;">
<?php print render($content['product:commerce_price']); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</a>
</td>
</tr>
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
I use the module "Commerce Price Savings Formatter" to view the original price, discounted prices and the discount percentage.
Prices are displayed correctly on my site and the mail client, except on gmail that removes all the CSS class (even inline style).
The next line problem <?php print render($content['product:commerce_price']); ?>
because it displays the entire price (original discount and percentage). I want to apply a style to the original price, a different style to discounted prices and a different style to the club proucentage.
I think we should create 3 cell. But I do not know what to put in the line :
<tr>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 20px; font-weight: bold; text-decoration: none;">
<?php ?????????; ?>
</td>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 20px; font-weight: bold; text-decoration: none;">
<?php ?????????; ?>
</td>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 20px; font-weight: bold; text-decoration: none;">
<?php ?????????; ?>
</td>
</tr>
How to do this ?
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
<tr>
<td align="center">
<a href="<?php print $node_url; ?>" target="_blank">
<table class="deviceWidth" border="0" cellpadding="0" cellspacing="0" width="580" align="center" style="border: 1px solid #ddd;">
<tr>
<td>
<table class="deviceWidth" border="0" cellpadding="0" cellspacing="0" width="280" align="left">
<tr>
<td align="center">
<?php print render($content['field_image']); ?>
</td>
</tr>
</table>
<table class="deviceWidth" border="0" cellpadding="0" cellspacing="0" width="280" align="right">
<tr>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #2b9900; font-size: 16px; font-weight: bold; text-decoration: none;">
<?php print render($content['title']); ?>
</td>
</tr>
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
<tr>
<td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #313a42; line-height: 20px; text-align: justify;">
<?php print render($content['body']); ?>
</td>
</tr>
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
<?php foreach($content['product:commerce_price'] as $commerce_price): ?>
<?php foreach($commerce_price['#prices'] as $price): ?>
<tr><td valign="top" align="center" style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 20px; font-weight: bold; text-decoration: none;"><?php print $price['#markup']; ?></td></tr>
<?php endforeach; ?>
<?php endforeach; ?>
</table>
</td>
</tr>
</table>
</a>
</td>
</tr>
<tr><td height="5" style="font-family: 0px; line-height: 0px;"> </td></tr>
</table>