Adding a Facebook Like Button to your email template

ariapsa / Pixabay

So you want to know ‘How to add a ‘Facebook Like Button’ to your email template‘. Ever since MailChimp promised to add the functionality to their system we have seen a buzz with people wondering how they do it. This article is a quick and dirty guide to DIY Facebook Like Buttons embedded in email templates.  So no matter who your ESP is you can embed a Like Button within your email design.

Well to be perfectly honest it really is not that hard, however contrary to what you may have hoped it is not quite seamless and there is no way for it to be. It involves a 2 click process.

The simplest way and the one most likely to work for most users is to use the following code.


1. Change the URL to the page you want ‘liked’

2. Change the img location and upload your likebutton image.

Other Implementations

The Mailchimp implementation is a little different. When you click the ‘Like’ button you are taken to the hosted version of the newsletter and the “Like Box” as above is overlayed as a div. You could also take this route by adding the code to your hosted version of the newsletter.

With a little tweaking of the code you can do one better than the new window that is launched using this method. What is not going to be possible is a single click with you landing on your facebook fanpage or your website homepage. There will need to be two clicks.You can have the like button delivered as overlay on the html version of your newsletter as one example.

What Mailchimp do
As MailChimp said in their recent release:

When a subscriber clicks the “Like” button in an e-mail, the campaign is then posted to their Facebook profile. Those “Like” behaviors are tracked by MailChimp and made accessible in the campaign social stats section.
While somewhat controversial, “Like” buttons have proved to be incredibly popular, especially for content creators and online publishers. Nearly 65 million users reportedly “Like” things daily, and TypePad users have experienced a 50% increase in referral traffic to their blogs from Facebook.

Qudos for MailChimp implementing this so quickly, but with a little tweaking you should all be able to do something similar relatively painlessly while you await your own ESP or software vendor adding similar social sharing to their email newsletters.

Anyone else have idea’s on improving on this basic implementation?

Credit to @iamelliott for inspiring this blog post with his question on LinkedIn

Previous articleDispelling the myth of deliverability magic & the standardisation of email metrics
Next articleSocketLabs announces 2010 growth in cloud based SMTP Relay
emailexpert is published by Andrew Bonar, the founder of the company Deliverability which is incorporated in Australia, Hong Kong and the United Kingdom. Deliverability has included Dotmailer, GetResponse,, SendLane and other ESPs as clients. Having launched his first website in 1990, he went on to become the co-founder of @POBox UK in 1993, a free email address provider, possibly the first in the world. Thereafter launching Cheapnet which became the longest running privately owned ISP in Europe before launching the first privately owned online payment gateway in the UK: Ebanx. Andrew has consulted to some of the worlds biggest senders including Amazon, Mondelez and Nestle. 2012 in his role as Global Deliverability Director at Emailvision was the first time he oversaw the delivery of more than 100 Biillion messages in a single year. Since that time he has provisioned consultancy or performed leadership roles at some of Australia's most successful tech companies. Including Campaign Monitor, and Kogan. With 21+ years of industry experience, Andrew is widely recognised as a leader in the field of message sending, deliverability and compliance. He currently resides in the Harbour City of Sydney and continues to serve as an independent consultant at organisations throughout Europe, the Middle East, Asia Pacific and the US.


  1. Hi,
    does this code works for live mail…

    I’m trying but I don’t know what’s happening, maybe I’m not doing it well…

    help please…

  2. How long has this blog been around? I have been searching for this kind of information for the past week and a half. Good thing I stumbled upon your blog.

  3. Hmmm…very good, there are a number of elements that I had not considered before.

  4. Thanks Tony I have made some amendments to fix some of those issues, hopefully that will make it easier for everyone. Still need to tidy up those comment tags..

    Jordan glad you found it useful.

  5. Terrific work! This is the type of information that should be shared around the web. Shame on the search engines for not positioning this post higher!

  6. Hi, in FF3 at least, what should be normal double quotes marks copy over as angled ones, and need correcting, and what should be & characters come over as the html for the ampersand.

    Great code though

    best wishes


  7. This is fantastic function that I am exploring as well. Would that affect the email deliverability?

    • Great Question. I have not tested it to any great degree. However, off the top off my head I would hope not for most part, but that said a link to might well trigger some corporate filters and some may even strip the link.

      So what to do if you fear this may be the case?
      Well I suggest the idea of linking to a web based version of your email or a big thank-you page which contains the “div overlay” with the like button embedded within that page.

      I will dig out the code for Overlay and write up an example if anyone wants it.

Comments are closed.