Emailing with no pain but pleasure


We all know that awkward moment when your only ticket left is “Emailing / newsletter module”. Which basically means :

  • Email server setup … Oh wait … You did it once and still have nightmares !
  • Investigate Amazon SES. Read the doc and you’ll want to hang yourself
  • Finally found a way to send emails through Gmail
  • Erm … damn spam filters …
  • Wait ! What ? The marketing team wants to be able to edit templates whenever they want …

1. Do it the right way !

Fortunately, like so many things today, there’s an API for sending email and making your life easier ! As a lazy developer I started investigating plug-and-play solutions first. Here is a non exhaustive list of what came up.

The features are pretty nice:
  • SMTP
  • Send API (through http)
  • ESP feedback, SPF, DKIM, clean IP, etc…
  • Transactional emails
  • Campaigns with user list
  • Live logs / statistics
  • Webhooks event notifications (bounce, unsubscribe, complaint …)
  • Mobile application

I choose MailChimp because it provides all of this nice features and has a good reputation. If you are looking for more informations about providers, you can read this article

 

2. Getting started with MailChimp

Fun monkey, lot of features, clean UI and 12000 emails/month included in the free plan. Nice start !

You can’t send transactional emails with MailChimp, they have a dedicated project called “Mandrill”. No worries, you can link your accounts, it’s pretty straightforward !

Templates

You can start with their “pre-designed” templates but I have to warn you, most of them are ugly … They have a basic WYSIWYG editor, useful if the market team needs to tweak some text ! I started from scratch (yeah I love 1990 html coding style …) and used the import tool. Just upload a zip and MailChimp’ll do the magic monkey dance for you ! Pretty cool :=)

Two things you have to understand to make it dynamic :

  • Merge vars : Contextual variables (*|EMAIL|*, *|FNAME|*, *|LNAME*| …). Defined in User lists.
  • Editable blocks : <span mc:edit=”myid”>.Set them when you send your emails.
If you need complex dynamic content you can also use the “feedblock”. Can’t wait to test it !

 

User lists

This is your user database, the backbone. If you already built your own database, you can sync it through their api. Use the *|MERGE|* tags as fields, such as birthdate, id, premium user, location etc … Then you generate groups or segments based on those fields.

This part is really powerful. The next time you’ll send a newsletter, no need to extract a csv from your database or handle unsubscriptions ! Each user has a rating based on emails opened / clicks / unsubscription / complaints / etc. You’ll easily know which users are really active or annoyed by your email.

The fields you defined in a list are accessible in your templates with *|MYFIELD*|.

Web Forms

MailChimp allows you to create web form widgets from your lists. Nothing else to say, just click it and embed it in your site or Facebook.

Campaigns

This part is the combination of templates and user lists. It sends massive emails. You can send a newsletter to a segment of your users with advanced filters. A/B split and rss-driven campaigns look nice but I haven’t tried it so far.

3. Send transactional emails with Mandrill


In MailChimp go to Account > extras > integrations and link your account with Mandrill. You’re good to go ! The free plan includes 12 000 more emails/month (remember MailChimp newsletter, Mandrill transactional).

Now in your templates list, click “send to Mandrill”. The template name will be your template id in Mandrill.

 

If you don’t need the MailChimp’s goodies, Mandrill is a standalone project.

Python Developer ? Here is the “official” repo named mail-snake. I maintain a fork for python 3k here. I’ll push the py3k support upstream as soon as possible.

mapi = MailSnake('YOUR MANDRILL API KEY', api='mandrill')
mapi.messages.send_template(
   template_name = 'template-id',
   template_content = [{
      'edit-block-id' : 'test_block',
      'content' : 'my dynamic content'
   }],
   global_merge_vars = [
   ],
   message = {
      'subject' : 'Hello World',
      'from_email' : 'no-reply@domain.com',
      'from_name' : 'Awesome Project Name Here',
      'headers' : {},
      'to' : [
         {
         'email' : 'toto42@gmail.com',
         'name' : 'Toto 42'
         }
      ],
      'metadata' : {
         'uid' : 'user id',
         'another_one' : 'premium'
      },
      'tags' : ['welcome'],
      'google_analytics_domains' : ['www.domain.com'],
      'google_analytics_campaign' : ['ga_campaign'],
      'auto_text' : True,
      'track_opens' : True,
      'track_clicks' : True
   }
)

> template_name : The template name in MailChimp / Mandrill

> template_content : Fill the mc:edit=”myid” you defined in your template

> global_merge_vars : Override merge vars (eg : *|FNAME|*)

> metadata : Mandrill logs all the emails you send. Use this option as a key/value index. (eg: Find all the emails I sent to a specific user). You can index up to 10 fields.

> tags : Simple tags. This will display a label in your logs

> Google analytics : Configure it if you want to associate the traffic from your mails to your website in google analytics.

 

MailChimp + Mandrill + RabbitMQ FTW !

 

Links :

5 thoughts on “Emailing with no pain but pleasure

  1. I’m doing something very similar to your example, yet my merge_vars are not getting replaced in the template when the email goes out. I’ve tried passing them in as global_merge_vars and merge_vars. Note that I’m not using predefined merge_vars, but rather custom variables that I’ve defined in the template like:

    Username: *|USER_NAME|*

    Then when calling:

    message = {
    ‘global_merge_vars’: [
    ...other args removed for clarity....
    'USER_NAME': 'a username',

    }]

  2. With merge vars you have to predefine variables and that’s a pity … I you can’t/don’t want to do it, use editable blocks :

    message = {
    template_content: [{
    'edit-block-id' : 'user_name',
    'content' : 'a username'
    }]
    }

    This should work :)

  3. It appears my scheme does work providing I send the global_merge_vars in correctly.

    ‘global_merge_vars’: [

    {'name': 'user_name', 'content': 'a username'},

    }]

    I was attempting to send in a simple dictionary, but in fact, one must send in a list of dicts with the keys ‘name’ and ‘content’. My bad.

  4. I must not understand something…

    My template is like this

    My json

    template_content = [{
    'edit-block-id' : 'mainbody',
    'content' : 'Hello'
    }],
    global_merge_vars = [
    ],

    However nothing is replace and it seems that it even stripes/empty the div

    Would you know what happens here ?

  5. It would be wrong to use the long mobile chat to be the lkve calculator.
    It seemed like total gibberish, and I had half a mind to capl her and yell at her for wasting my time.
    Instead you should use whatever modes of communication are in wide use by the public inn order to optimize
    your influence with your services. You might ask for something
    which is extra ordinarily expensive. The best thing about it is that there are no pressures in any way.
    People are lonely.

    The world of dating has certainly changed in tthe years
    since the Internet was introduced. However, try avoiding questions related to work issues, if she iss not comfortable with it.

    This 1st showed itself within the random, roulette-styled chat systems that are thus
    proliferated on video sites (pranks andd hilarity abound).

    Definitely consider getting background checks, doing so
    can be inexpensive and will kedep you much safer from unwanted and unexpected experiences.

    Music, Movies, Etc.

    Free chat lines will enable you talk to someone across the ocean from youu while you safely
    test the waters of a new relationship. Geet into it and transform your social
    lide into what you deserve. Many have said they’ve tried Facetime Sex chat annd enjoyed.

    I agreed with her, because I had my previous experience with searching for a
    good service. A single operator can only really talk to one
    customer at a time,and the costs incurred to maintain a phone setup (bills, workspace and salaries etc) are high.
    Do your socializing through good chat rooms.

    This is ofyen called cell phone chat. So you can listen too aas many people as you want to befote you decide who to contact.
    And you might share a common sense off humor.
    When I asked her later, she was surprised that I didn’t understand, saying that itt was a relatively simple message.
    Don’t try to use these tips to play around.

    The first words are the hardest! You caan ask all kinds of questions
    on phone chat which you woud not be comfortable asking in person. Create your profile and provide the mandatory details
    that are prompted, while sighing up. Almost all girls keep tabs on the latest happenings in the entertainment arena,
    bbe it music, movies, television and the latest gossip on the celebrities.

    Visiting chat rooms that provide a service with well-drawn up rules aand regulations will probably mae youir online experience much more pleasant.
    You can find a sexy guy or a girl on the adult chazt linmes to
    share your intimate thoughts and fantasies with.

    Topics that Girls Love to Speak About Her Hoobbies If you want
    to break the ice with a girl, then this is the most reliable option you have.
    The great thing about free chat lines is that you can leave
    someone a message for those first words. Some girls love
    to devour Hollywoodd gossip, while some might bee avid Harry Potter fans.
    Nationwide services can afford to advertise so generalply haave
    a llot more members. He wwas a fifteen years old kid who fell in love wit mmy ex
    wife.

    Ask if she likes to party. Learn how great dates and great relationships are made the mpdern way.
    Moost foreign and Filipina elationships start
    wiyh these websites that cater ree Filipina video chat as well.
    For many online marketers, this strafegy sewms to bee paying of
    considering the fact that molst businesses are spending more money
    on onloine advertisements than on television. That said, we live in a big, bad world and it iss very important that wee keep our wits about us and don’t behave foolishly or carelessly.

    Talk to herr about herself by posing the right question and it
    iis ample to keep the conversation going forward.
    Eveen though must people aree trust worthy, there is definitely
    some scary and violent people out there. Suppose, you are going to the office and you have free
    time in your car. Then you need to know about free
    phone chat lines and you can use them too help you meet people.
    After all, it is only these that you have when shifting from one job to the other.
    How tto Connect to Local Phone Chat Lines The large nationwide
    phone chat lines are easy to locate.

    Herr Dreamjs and Aspirations Forget the yesteryear, these days women have become career-oriented and have several dreams and aspirations in life.
    Luckily a short chat with the kid and his father prevented from further prank calls.
    They did but giv some helpful variety-rich communication aand
    interaction setting with a high level off safety attributable to distance.
    It is one of the fastest and most enjoyable means to converse with another person today.

    You can talk to or send text messages to other
    members on your cell phone.

    Chat line phone numbers are
    a tactful way of connecting with people eiher for fun,socializing, oor dating.
    That is right, I said yummy bell. Divorce rates are worse then my credit ccard rates.
    They are very easy too use actually. The means most people
    use are dubious and leaves a lot to be desired.

    And after a week on Facebook or MySpace, a beautiful
    woman will have learned to spot and delete suc messages
    in an instant.

    If you feel positive about any off the above questions, the gear
    yourself for the modern type of datting thiis 2009:
    phone chat. Simple: This is a message that starts oout like most of the everyday
    mails she’s recewiving from other guys (“your’re so cute”), but right in the
    second sentence, the whole meaning is turned upside down. You could call tthem ddating secrets,
    but in reality, you will find them in anyy social interaction. Phone chats are
    available anywhere, anytime and itt can be used on any phone.
    Your real name could give out several information regarding you.So make sure hat you
    use your surname or use your initial for chatting. Personally, I know that
    I amm very curious about other people.

    Girls are sensitive, if girls know that you are making
    an effort, they will appreciate it. Many local phone chat lines offer free trial periods.
    What is fuynny about this situation, is that she acctually susppected me
    of harassing her.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>