Friday, January 30, 2015

Email template: eDM SPECIFICATIONS


- Content must be supplied in HTML
- email body width: 600 pixels
- Total file weight (including HTML, CSS, images): 50KB
- We cannot accept emails built with CSS in the header tags or that include flash or forms!
- Use HTML tables for layout. Tables control the design layout and presentation.
- Use Standard Inline CSS. Do not design your HTML as a web page. Most web-based email clients strip Header CSS


- Explicitly define colour values as email clients may have different default colours which vary from web browsers.
- All image tags should include width and height attributes as stretched images will not render correctly in some email clients.
- <div> tags as the box model is not supported by a majority of e-mail clients and should be avoided. Tables should be used for e-mail layout. Also, avoid using rowspan as it won’t render consistently.
- It is recommended to set cellpadding and cellspacing to 0 on the table elients.
- Line-breaks (<br />) should be used instead of paragraphs (<p>) to ensure a more consistent rendering.
- Use blank <td>s with spacer images or alignment techniques with nested tables where necessary instead of padding or margin attributes as some email clients do not support them.


- There are many different types of email programs and it is likely your email will display differently across each of them. For this reason we ask you not to put CSS in the header tags or link to a CSS file since many email programs will not recognise it.
- You may wish to use standard in-line CSS coded HTML e.g. <span style="font-weight:bold; ...etc..."> as opposed to <span class="style 5">. If so, please refer to the attached guide from Campaign Monitor which details the programs that support CSS.
- Please note, Outlook 2007 uses Word 2007 to display HTML email and not Internet Explorer, which strips out all CSS. Our advice is to keep your email design simple to ensure your email will appear as intended.

Tuesday, January 27, 2015

Email preheader best practices, Preheader email marketing and email preheader html

A preheader is a small section that appears at the top of your email. The following tips can help you make the most of the preheader in every marketing campaign  you develop.

  • Understand that the first line of your text is critical. It is this text that will appear when recipients access their inboxes from smartphones, tablets and other mobile devices.
  • Know how to code the preheader properly. The preheader should convey the message of your email clearly and concisely.
  • Use the preheader text to summarize your offer in a way recipients can easily understand.
  • Keep things short and simple. Your recipients are busy, and they are probably looking through dozens of new emails every time they log on to their mobile devices.
  • Use left alignment for your preheader text. This will make the text easier to read, especially on mobile devices.
  • Use a standard easy to read font for your preheader text. Now is not the time to get too fancy.
  • Include a clear call to action in your preheader text. Link your call to action to your landing page.
  • Test your preheader text as you would any other part of your email. Try various A/B splits to see which preheaders have the best response and open rates.

   /* ... */
    /*--- Preheader declaration in style block in addition to inline for Outlook */
    .preheader { display:none !important; visibility:hidden; opacity:0; 
color:transparent; height:0; width:0; }

  <!-- PRE-HEADER TEXT -->
  <span class="preheader" style="display: none !important; visibility: hidden; 
opacity: 0; color: transparent; height: 0; width: 0;">Preheader text shows up 
in GMail, iOS,, &amp; more: 75 text char limit</span>

Wednesday, January 21, 2015

Convert from MySQL datetime to another format with PHP

// $datetime is something like: 2014-01-31 13:05:59
$time = strtotime($datetimeFromMysql);
$myFormatForView = date("d-m-Y g:i A", $time);
// $myFormatForView is something like: 01/31/14 1:05 PM

Tuesday, January 20, 2015

PHP get Google News RSS Feed

If you know how to get the HTML data from the right XML-element (<description> in this case) you can just strip all HTML with PHP's strip_tags

This seems to work like you want it:

$news = simplexml_load_file('');

foreach($news->channel->item as $item) {
    echo "<h1>" . $item->title . "</h1>";
    echo '<p>' . strip_tags($item->description) ."</p>";