It’s always important to remember that coding an email template is not like coding a website – different rules apply. Unfortunately, email clients are not as advanced as one would hope they would be, so when coding, one must remember to keep things as simple as possible.

A few weeks ago I wrote a post about important factors to consider when using background images and how it can affect the delivery of your email. This week I’d like to talk about limiting the size of your templates.

Even when coding a website you have to think about how different browsers and screen sizes will render your site. The same applies to email – except you have some different limits consider. While there is no set limit in length, email clients have a default width limit of 600px. It’s important to keep in mind that email clients will not use the full width of your screen to display your email – the last thing you want is for the email to look completely different than in your preview!

If you want your email to be viewed in one clean, straight view that does not require any extra scrolling from left to right, the 600px rule is something to keep in mind.

Luckily, our own Email Campaign Builder can help if you’re stuck – it will resize all images for you to 600px, and even gives you the option to resize/crop any images in your Image Library.

 

So how will this affect you?
I ran a test with a dummy campaign using Email on Acid for Gmail and Outlook2003 – here’s what would happen if I sent an email with 800px wide content. (based on a 1024×758 standard monitor size)

on Gmail

on Outlook2003
 

Notice how in both instances, the template and images are way too large for the preview pane to properly show the email.

Now here is the same email, but with the template at 600px

on Gmail

 

on Outlook2003

Not only is the 600px test cleaner, but I can see more of the content of the email in the preview pane. It required a lot less work to try to figure out what the email looked like.

By keeping these rules in mind when coding templates and you will ensure that your subscribers see exactly what you intended in their inboxes. You can also use tools like Litmus  or Email on Acid to preview campaigns across multiple email clients.

 

 

 

If there is one rule of thumb when it comes to coding HTML email templates, it is to remember that coding a template for email is not like coding a template for a website. There are many attributes that, while they seem pretty obvious they should work, they actually do not. One of these attributes is a background image.

Background images in HTML email templates have long been acknowledged as inconsistent in their rendering across email clients. While modern email clients (such as those on iOS devices) may display them correctly, more traditional desktop email clients, like Outlook, offer absolutely very little support. Modern web clients like Gmail have recently implemented background image support, ‘background-position’ is still not supported. Hotmail, in the meantime, offers very limited support on this.

Many users feel that background images are important features, there are a few factors that should be taken into consideration before using a background image in an email:

  1. Remember that many email clients offer a “preview pane,” which may not render the image correctly. This could cause your background image to look distorted.
  2. Your campaign should include an equal image-to-text ratio. CakeMail offers a testing tool called SpamAssassin, which will help you analyze your image-to-text ratio. Here are a few things to aim for:
    • A maximum of 40% image coverage
    • A minimum 60% text coverage
    • More than 3 images in the page – if any at all.
    • Not all images touching
    • At least 400 characters of text

    As per anti-spam law, all emails must contain some form of text (even if it a simple “hello”). Image-only emails will not display properly and are almost certain to be flagged as spam.

  3. Always assume that the majority of your readers will use an email client that will strip out your background image. Here are a few design tips in case that happens:
    • Give your table a background color that matches the background image as close as possible.
    • Make sure there is enough contrast between your text and the background image/color in case the background image is stripped out.

If you would like more information on background image support across all email clients, take a look at The Email Standards Project homepage.

Canada’s Bill C-28 (also knows as CASL) is moving forward with last week’s release of the Canadian Radio-television and Telecommunications Commission’s final set of regulations under Canada’s new Anti-Spam Law.

The final Regulations include the following changes from the original proposal:

  • - Clarification that persons sending a message, or persons on whose behalf a message is sent, must identify themselves by the name by which they carry on business.
  • - Greater choice with respect to the contact information to be provided.  Senders, and those seeking consent to send messages, must still include a physical address, but may now provide either a telephone number providing access to an agent or a voice messaging system, an email address or a web address (the original proposal seemed to require the provision of all of these).
  • - Revised requirements that web-based information be “readily accessible” and that the required unsubscribe mechanism must “be able to be readily performed.”  (the original proposed Regulations specified these requirements with reference to a maximum number of “clicks”).
  • - The revised Regulations now indicate that consent for the receipt of a commercial electronic message may be obtained orally, as well as in writing, as the original proposed regulations provided; however, the Regulations do not provide certainty as to whether electronic forms of consent will be considered to be “in writing,” which was the chief concern of many stakeholders with this requirement.
  • - The Regulations still require that when seeking consent, requestors must include a statement indicating that consent can be withdrawn, but no longer requires the requestor to specify through which avenues such a withdrawal of consent could be made.

What’s next?

Now that the CRTC has set the ball in motion, we’re waiting for Industry Canada to release their own set of regulations in the coming weeks, with a 30 day comment period to follow. After these comments are reviewed final regulations will be presented and an enforcement date will be set. Industry Canada will hopefully clarify this, but CASL looks to be coming into force sometime in Q3 2012 (October).

Bye for now,

Kevin

Last week I was at Confoo to present my talk, jQuery Spagetthi. This talk was a collection of best practices with jQuery, since it was somewhat popular why not put that in blog post form. Brace yourself, it’s a long read (you can also download the french slides here).

custom.js cultural problem

It seems a lot of web agencies took the jQuery mantra a bit too far, “less code, do more”. When you work as a front-end developer in one of those agencies and you do website maintenance you always open the js folder in fear.

Probably not what you want to do in your code..

Generally you find a couple of plugins and one file called, custom.js. When you open that, sometimes you are lucky and it only has a couple of lines. Even if the code looks like crap, well, you could recode all this in a couple of hours.

But… Sometimes you are less lucky, and you got a 2000 line mess where you not only get  100 events binded everywhere, you also get an onslaught of selector traversing using .parent() that never stops.

At the end of your day working in that mess, you want to become an alcoholic and change job, illustrated below.

So what we are going to look at is how you can improve on the mess..

Events

jQuery offers you 3 types of event handler, you get

  1. bind(), binded directly on the html element and need to be there when bind() is loaded
  2. live(), that use event delegation and is binded directly on the document
  3. delegate(),like live() use event delegation but with a context, can be binded on any element in the DOM

Event Delegation, (bubbling) – what is this?


Basically, any event fired on any element in the dom can be cached on any parent of that element. jQuery use that feature and for example, you could use delegate on a form to bind events to inputs so the events never leak that particular form. More information on event delegation can be found here.

Abuse Delegate

You should probably always use delegate as it has a lot of advantages over bind() and live().

  1. Bind() is slow when used on a collection of html objects, example, you bind something to 20 inputs, it will have to actually parse all your html documents and bind 20 times your event for each element. Delegate does not suffer from this, you bind it only one time on the form, and let the event delegation magic do the rest.
  2. live() has no context, meaning that since it is binded directly on the document there is a change events leak out. Imagine you use live on a button having a class .btndelete, there is a probable chance somehwere else another developer use that class to, delegate prevent events leaks to the global space like a closure does for variable.

Custom Events

This jQuery feature is generally underused in a general matte. There are several cases where it can make your code better, but first let’s look at the example below.

// Pour ouvrir un lightbox en script en utilisant le plugin colorbox
// Ce script n'est la qu'une fois au travers de notre application
$(document).bind('lightbox.open', function(event, config) {
  $.colorbox(config)
});

// Dans notre script, on ouvre un lightbox
  $(document).trigger('lightbox.open', [{"href":"/popup", "height":400}]);

The first big use case of custom events is to decouple your code from your 3rd party plugins. The best example is the lightbox. The are several lightbox plugins, and it is not because you use one of those now that a better might popup later, or might break with ie10. Using custom events you could create events that you decide and use them in your code and only binding those events to your 3rd party in one place.

Since you bind it only once, changing the plugin is really easy and does not consist of 30 find and replace actions. Plus, you build a standard for your company and make it easier for employees to pick up the standard.

The second use case is for decoupling your js modules. Imagine what happens if you directly call functions from another module and that module is removed from the application? Well, you get js errors in your script, but if you use custom events to do that, there’s no problem.

See the example below:

You want to modify the name of your user but also have another module where the name is printed. In this case you have 2 choices.

One, you modify the html directly from that module, but that’s not very convenient. There is no way of other developers knowing that you’ve done this since nothing shows up on other pages to notify them that your save button modified this html.

Two, You use custom events like “change:name” and you let the left module handle it. If you do that, there is never other ways to change your name – you can just call that change:name event and the left module will handle the rest.

Selector Traversing

One of the big hurdle when you start with jQuery is selector traversing, most people stop at the first option, .parent(). Unfortunately using it is not far from being an anti-pattern. What happens if another dev add a div between your button and your container? Your code is broken, and worse, no one even knows it.

Fortunately there is an easy solution: using closest(), it’s like parent() on steroid. with closest, you pass your target selctor class like this closest(“.container”) and jQuery will magically move up in your dom tree until it hits the selector.

Easy!

Ajax Requests

Since jQuery 1.5, we have a new kid in the block, deferred. Before 1.5 $.ajax was not chainable, and that was not cool! What if you want the same ajax request but with the different success functions? Fortunately, deferred changed all that. Look at the example below:

 

It also added lots of functionalities that it would take too much time to get thought, but one I wanted to talk about was $.when.

$.when

Imagine you have 2 ajax requests at the same time, and you want to execute something after those 2 ajax requests have been executed. Before 1.5 it was really weird; you would have to check if both requests were executed in your success function and save states. So much overhead. With $.when, you just pass your request ajax to it and jQuery does the rest, an example explain it much better:

Code Structure

I know talking about code structure is kind of a picky subject. Everyone does their own thing and well, I do not want to get into that. But for the love of god, do not put a endless series of event directly into the dom ready! Please at least use objects to structure all that. If there is one thing that backbone does well it’s handling events, so lets have a look a typical backbone.js view:

How can we take this and turn it into vanilla javascript? Well it would look like this:

var mailapp.events.users = {
  initialize: function(){
    this.$usersWrapper = $("#usersWrapper");
      if(!this.$usersWrapper.length) this.loadEvents();
  },
  loadEvents: function(){
    var _this = this;
    // launch our modal events
    $.subscribe("modal.complete", function(){ _this.loadPopupEvents(); });

      // Delegate give a context to our events
      this.$usersWrapper
        .delegate("#btnDelete","click", function() { _this.deleteItem(); return false; });
        .delegate("#btnsave","click",   function() { _this.save(); return false ;) );
        .delegate("#btnModify","click", function() { _this.modify(); return false ;) );
  },
  loadPopupEvents : function() {
    $(".myPopupForm").validationEngine();
  },
  deleteItem: function(){
    $(this).closest('.item').remove();
  },
  modify: function(){
    var jQitem = $(this).closest('.item');
    jQitem.find("input").css("display"," block");
    jQitem.find(".name").css("display"," none");
  },
  save : function(){
    var jQitem = $(this).closest('.item');
    jQitem.find(".printNom").html($(this).parent().find("input").val());
    jQitem.find("input").css("display"," none");
    jQitem.find(".printNom").css("display"," block");
  }
}

So that is a lot of code. Let’s take it apart.

initialize()

 initialize: function(){
    this.$usersWrapper = $("#usersWrapper");
      if(!this.$usersWrapper.length) this.loadEvents();
  },

I always bind a js module to a part of html document, in init I check if my html container is in the dom. If it is not there, full stop. The rest of the module will not be loaded, and this reduces the overhead and leakage I could get if the module is loaded in another part of the application where it should not be loaded (or if all the js is concentrated in one big js file).

If we have our html container, let’s move to loadEvents().

loadEvents()

 loadEvents: function(){
    var _this = this;
    // launch our modal events
    $.subscribe("modal.complete", function(){ _this.loadPopupEvents(); });

      // Delegate gives a context to our events
      this.$usersWrapper
        .delegate("#btnDelete","click", function() { _this.deleteItem(); return false; });
        .delegate("#btnsave","click",   function() { _this.save(); return false ;) );
        .delegate("#btnModify","click", function() { _this.modify(); return false ;) );
  },

All our events in here are loaded with delegate using the html container that I saved earlier in init. We also have a custom event modal.complete that is fired when a lightbox is opened, so it is now really easy to bind events into our lightboxes without any pain.

That’s pretty much the interesting part of the pattern.

Other patterns

The pattern above is one of the easiest and simplest one you can use. Of course there is other solutions out there where you can get private and pseudo protected space. One of my favorite is the revealing pattern, another pattern much underused is the jQuery plugin pattern.

For the most part, every company has their own tabs, sliders, lightbox and other plugins. The problem is, most of the time it is a bunch of code with no settings that is copy pasted from project to project with changes directly applied to the core code.

That’s unfortunate since it really does not help the company grow their js code library. I’m not going to show how the jQuery plugin pattern works, since it is already well explained, but it’s cool and easy have a look!

If you want to go in depth with javascript pattern I recommend Stefan Stefanov book, rightly named Javascript Pattern.

Conclusion

This is a good chunk of my presentation here – I hope it can be useful to some of you guys. As I said in my talk the idea was to give a bunch of advice so you guys can apply what work best for your company and your style and trow the rest in the bin ;)

Tweaking an HTML email’s design can be tricky and you may find out that your design is not consistent across all email clients.

Here are some tricks for you:

  • Code like 10 years ago: use tables for layout, use web-friendly default fonts, like Arial, Helvetica and Verdana.
  • Verify your styles/CSS with our Premailer add-on: Premailer is a core feature for us and will not compromise the quality of your design! We want your code to be as perfect as it can be, and Premailer takes care of just that.
  • Know an email client’s limitations: Always verify with The Email-Standards Project  to keep up with today’s standards. If you aren’t sure what features are supported on which email client, this is the perfect place to check up on that.
  • Being a late-adopter is ok: HTML 5 is AWESOME (we love it) but not every email client is ready for it. Use it with caution if you must use it at all, and use testing tools like Litmus to make sure everything looks a-ok before you hit send.

If you need further help or have any questions or comments, be sure to contact us or leave a comment below!

In compliance with Canada’s New Anti-Spam Law (Bill C-28), The CAN SPAM ACT of 2003 and CakeMail’s existing Anti Spam Policy all senders using our service MUST include the physical postal address of the sender in their email, along with an unsubscribe tag. Not only is it illegal to send commercial-based email without a valid postal address, it goes against Sender Best Practice of not showing proper accountability to the recipient.

The receiver should be able to readily contact the sender (by any means possible) if they no longer wish to be contacted via email. Failure to adhere to this policy will result in the termination of your CakeMail account.

In order to protect you (and us!) from this happening, we have modified our existing detection system to alert us so we can properly resolve this issue before it happens. In CakeMail 3.2, the system automatically searches for both an unsubscribe and an address tag. If they are not detected, you will not be able to move forward and schedule your campaign.

The user attempting to schedule the campaign will be notified immediately, and if the physical address is missing, you’ll have the option of entering the information in a pop up. Once the information has been edited, the tag will be added automatically for you in the footer of the email. (You will also be notified that the unsubscribe tag is missing and that process will be automatic as well)

 

To read more about this topic, please refer to our Support Document.

Six approaches for future-proof email marketing
Once again, Mark Brownlow makes a good interesting piece on the best things to focus on while creating email marketing. Read the whole article to get all the useful links!

  1. Understand the true meaning of value: avoid one-way value, don’t overestimate value, don’t misunderstand value : the value that count is the value for the recipient, not yours.
  2. Be willing to tweak and change:Each new email is an opportunity to test a tweak, and each tweak can have a surprisingly positive impact.
    * Subject line tests that double open rates over time
    * Changes in link wording that produce over 50% more clicks
    * From line tests that pull in over 20% more clicks
    * Link format tests (button vs text) that increase clicks 67%
  3. Respect the basics
  4. Be unique: Valuable content and offers, permission, creative design, relevancy, timing, personalization, customization etc. are important factors that can take your email marketing amplifier all the way up to 10. What takes it up to 11?
  5. Use common sense
  6. Dig deeper in the numbers


Email Research: The 5 best email variables to test

Marketing Sherpa has done research with marketers asking them what are the best things for email marketers to test (and do they test them?)

  1. Target audience: 42% of email marketers believe testing the target audience is very effective (but only 30% are doing it…)
  2. Landing page: 41% declare testing it is very effective
  3. Subject line: by far the most tested variable (72%) but declared very effective by 35%
  4. Call-to-action: very near with 34%
  5. Personalization: also near with 32% of marketers believe testing it is very effective

Spammers are forever trying to find different ways to abuse the system and ISPs are forever trying to figure out new creative ways of stopping them. Engagement is nothing new – it’s actually been around for a while (we’ve mentioned it a few times here, and here) – but ISPs have only recently started making delivery decisions based on this kind of data.

What does this mean?

If the email you are sending does not engage your readers, chances are it’s going to be sent straight to their junk folder if you don’t make some changes.


One of the great things about new product releases is that you get to add all the cool things you wanted to add in previous releases but didn’t quite have time for. And more importantly, you get to include some of the great suggestions we receive everyday from YOU, our customers!

Showing List Engagement is one of the things I advocated for in this new release. Under the Contact Lists tab in v. 3.1 and higher, you’ll now see an active panel that not only displays the number of lists and subscribers you have across all your lists, but the number of total emails sent and the average engagement level of your list:

How does it work?

Our new Engagement measures the quality of your relationship with your subscribers. The average click and open rates for the last 6 months are combined and given a grade out of 10.*

Half a star = 1 point

The greater the number of stars, the higher your engagement, the better the list!

*takes into account Opens vs Unique Opens as well as Clickthroughs vs Unique Clickthroughs.

ISPs also take into account the number of complaints you receive, the number of hard bounces you generate, the number of spam traps you hit and whether or not your content is flagged by their content filters. They look at this data along with 3rd party reputation metrics to determine where to place your email.


How do I boost my Engagement?

Your open & click rates are determined by many things, but on average you should be seeing anywhere from 10%-60% dependant on your reputation, how well you build and maintain your lists and of course, the content you are sending.

The data never lies, look at our basic delivery model. Start by focusing on past campaigns. Did some perform better than others? Ask yourself why. Was it something as simple as the subject line? Did your email contain an attractive offer your customers could not resist? Did you effectively target a specific portion of your list through segmentation to help boost performance?

Tips:

  1. Identify your audience and target your campaigns accordingly – this data should be part of your onboarding process, find out as much as you can (within reason) and use it to your advantage.
  2. Use appealing subject lines – knowing what your email is about before they open it is extremely important.
  3. Learn from your mistakes – finding out what didn’t work is almost as important as what did!
  4. Retire inactive users – people that have not opened/clicked in a while are deadweight. Try a win-back campaign and if that doesn’t work, remove them from your list entirely.
  5. Test – try using A/B Split campaigns to maximize the effectiveness of your content.

Another thing you can look at is your analytics reporting. What happens when the user has opened/clicked through and they are sitting on your webpage? What is their average time on your site? What is the number of page views? Did they convert? Did they purchase something?

“Set a course for the Inbox, Commander, Warp 9 – ENGAGE!”

Bye for now,

Kevin

PS. Sorry for the Star Trek reference at the end there, I couldn’t resist. :)

Don’t you just love the Holidays? I don’t.

Well, I do love the holidays really, but the truth is that for email delivery folks, it’s a very stressful time of year. Not only do email volumes go through the roof, but people seem to forget (or ignore) some basic rules of email marketing that they wouldn’t otherwise think of doing throughout the year.

Because the lure of sending email to as many people as possible to increase ROI is just too good to pass up this time of year, typically good senders can sometime turn a blind eye when it comes to best practices. They reactivate inactive users, they use lists that haven’t been sent anything in months, they send 5 emails a week instead of the usual 1 etc, etc.

As we all know, Black Friday in the US is the biggest shopping day of the year…but I affectionately refer to it as Blacklist Friday because that is usually what results for many email marketers.

ISPs (and email receivers in general) are constantly trying to find good ways to filter spam. One of those ways is by using blacklists. A blacklist is a list used by receiving networks to judge a given IP and/or sending domain’s reputation. These lists are run by Anti-Spam groups and most blacklistings are the result of sending Unsolicited Bulk Email (UBE) to addresses that never asked to receive it.

There are many different blacklist providers in existence and some carry more weight in the community than others, but they are all an indication you are doing something seriously wrong. I’ve mentioned this before, but a lot of people think blacklists are the bad guys, when in fact they should be regarded as friends (not foe). The feedback they provide is not only free, it’s an extremely viable way for ISPs to keep spam out of your own Inbox. Getting blacklisted also alerts you (the sender) to problems with your marketing practices you might not be aware of. You should think of it like your child’s report card in school. If your kid fails a class wouldn’t you want to know about it so you can help them and fix the problem?

There are 2 basic kinds of traps, “Dormant” and “Bonafide” traps.

“Dormant” Traps

An email address that once existed, and may have even signed up to your list legitimately at one point but they have since become inactive.

“Bonafide” Traps

An email address that has been created intentionally to catch people scouring the internet looking for any address they can find. These traps do not belong to a real person (and never did) and could never “opt-in” to any list since it is impossible for the address to initiate, respond or give consent to having received email of any kind.

Essentially, ISPs want to know if people are:

  1. Harvesting addresses off the internet
  2. Sending to lists that are very old
  3. Handling & Processing hard bounces correctly

It allows them to judge the incoming mail from that sender so they can add it to their overall reputation score and filter it (if necessary).

An Example:

abc123@hotmail.com is deactivated because the person that signed up for it is no longer using it. From the date it becomes inactive for a period of 6-12 months, it will return a hardbounce if you try to send it an email. So… people that are sending regularly and removing hard bounces from their lists properly will abandon this address in the process. People that don’t do this obviously will still list this address as ‘active’.

After 12 months, Hotmail will stop returning a hardbounce because it feels that any responsible marketer would have already removed this address from their lists.

If you keep sending to it after this time, it could result in a negative reputation at Hotmail and together with all the other stuff they look at.. could mean email from that sender will start going to the Junk box. Blacklists do the same thing, but they also receive inactive spam traps from ISPs, Registrars, they buy domains of companies that have gone under, etc.

Email marketing is far different to any other method of reaching out to your client-base. The actions of one single email address going to the wrong place or the wrong person, can seriously affect your reputation and your delivery. This is the worst time of year to take risks with your sender reputation, risking account suspensions and blacklists with activities like reactivating old lists.

Opt-in check boxes need to be empty, confirmation emails need to be sent and you need to send to your list on a regular basis. This is the only way we can avoid having this issue during the busiest time of year.

Happy Holidays!


Email’s Death Has Been Greatly Exaggerated

They’re always trying to scare us, but David Daniels from ClickZ, shows off some statistics that defy those predictions:
- 93 percent of online consumers check their email account at least once a day, if not more frequently.
- About 25% of consumers say that they maintain a separate email account just for marketing purposes, females are slightly more likely to do this at 30%, as much as 41% of consumers ages 38 or younger.

It’s the Mobile Wonderful Time of the Year
Return Path reminds us that during the busy season, people are using mobile even more to stay connected. Here are few more tips to help your emails get to them:

  • How does it look? Take a look at your email campaign on a mobile device to experience firsthand how limiting the 3rd screen can be.
  • Are you flexible? Consider using the pre-header space to offer links to view mobile and web versions of your email, as well as a clickable summary statement of the message content.
  • How big is too big? Review the width of your email – downsizing may improve mobile viewership without sacrificing the web experience.
  • Is your message legible? Images usually aren’t visible (with the exception of the iPhone), so if your message isn’t in a text format, it can’t be read. And, if your links are button-format only, subscribers can’t respond either.

Did Monty Python write your unsubscribe page? 9 tips to make it better
A article from the always funny-tones Mark Brownlow on what not to do in you unsusbcribe form. But some real tips too!
A few example of what NOT to do:

Al Capone fear-based option:
bad unsub example 4
The King Eurystheus method, involving a few Herculean unsubscribe tasks:
bad unsub example 2

And how to deal with those three groups of unsubscribers: the unavoidable, the switchers and, the real problem, the dissatisfied.