<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Merge Tags on Netsensei</title>
    <link>https://www.netsensei.be/tags/merge-tags/</link>
    <description>Recent content in Merge Tags on Netsensei</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>nl-NL</language>
    <managingEditor>matthias@netsensei.nl (Matthias Vandermaesen)</managingEditor>
    <webMaster>matthias@netsensei.nl (Matthias Vandermaesen)</webMaster>
    <lastBuildDate>Wed, 13 Jul 2011 21:11:46 +0000</lastBuildDate><atom:link href="https://www.netsensei.be/tags/merge-tags/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Mailchimp, group names and merge tags</title>
      <link>https://www.netsensei.be/2011/07/13/mailchimp-group-names-and-merge-tags/</link>
      <pubDate>Wed, 13 Jul 2011 21:11:46 +0000</pubDate>
      <author>matthias@netsensei.nl (Matthias Vandermaesen)</author>
      <guid>https://www.netsensei.be/2011/07/13/mailchimp-group-names-and-merge-tags/</guid>
      <description>&lt;p&gt;Okay. This is a post for future reference.&lt;/p&gt;
&lt;p&gt;Lately, I’ve been working on a Drupal project which involves
&lt;a href=&#34;http://www.mailchimp.com&#34;&gt;Mailchimp&lt;/a&gt; integration. Mailchimp is an excellent service which manages all
the monkeyjobs while you can send out newsletters to lists of subscribers
carefree.&lt;/p&gt;
&lt;p&gt;The service allows you to create a (or use a predefined) reusable template for
your newsletter. You pass the content which needs to be send out on a frequent
(weekly? monthly?) basis to your subscribers to Mailchimp and it will churn out
a new newsletter based on your template.&lt;/p&gt;
&lt;p&gt;One of the requirements of the project is that a subscriber can opt in to
receive a customized newsletter based on selected interest groups. The content
of the newsletter are &lt;a href=&#34;http://www.drupal.org&#34;&gt;Drupal&lt;/a&gt; nodes that were published since the last
edition of the newsletter. Using the taxonomy module, these nodes are assigned
to one or more of the twelve available interest groups.&lt;/p&gt;
&lt;p&gt;I need to aggregate the data in Drupal into digestible content and send it in a
single Mailchimp campaign. There’s a catch though: a campaign is send out
to all users, not those that have opted in for interest groups x, y or z. So,
how can you solve this?&lt;/p&gt;
&lt;p&gt;Enter: &lt;a href=&#34;http://kb.mailchimp.com/article/how-do-i-use-smart-merge-tags-with-groups/&#34;&gt;smart merge tags with groups&lt;/a&gt;. Using Mailchimps’ smart merge
tags within the newsletter content generated by Drupal, I can target specific
interest groups.&lt;/p&gt;
&lt;p&gt;Like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;br&amp;gt; *|INTERESTED:Interests:Sports and entertainment|*&amp;lt;br&amp;gt; Node Title B&amp;lt;br&amp;gt; *|END:INTERESTED|*&lt;/code&gt;
``&lt;/p&gt;
&lt;p&gt;&lt;code&gt;*|INTERESTED:Interests:Lifestyle|*&amp;lt;br&amp;gt; Node Title A&amp;lt;br&amp;gt; Node Title C&amp;lt;br&amp;gt; *|END:INTERESTED|*&amp;lt;br&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Depending on the interest groups a user is subscribed to, only the content
relevant to him or her will be shown in the newsletter. Thus creating
personalized newsletters. Pretty cool!&lt;/p&gt;
&lt;p&gt;There are a few limitations though. Over the past two days, I’ve been
sparring with the Mailchimp support desk (They’ve been great and very
helpful!) about the usage of commas in group names. You could do something like
this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;br&amp;gt; *|INTERESTED:Interests:Sports and entertainment, lifestyle|*&amp;lt;br&amp;gt; Node Title D&amp;lt;br&amp;gt; Node Title E&amp;lt;br&amp;gt; *|END:INTERESTED|*&amp;lt;br&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Which will act as an OR filter showing content to people who are either
subscribed to ‘Sports and entertainment’ or ‘lifestyle’.
But what if your group names themselves contain commas? What if you had a group
called ‘Sports, Culture and entertainment’. Well, Mailchimp will be
confused and think these are two groups ‘Sports’ and ‘Culture
and entertainment’. Since those are nonexistent groups, the content
won’t show up at all. I’ve tried escaping the commas and putting
everything between quotes: nothing works.&lt;/p&gt;
&lt;p&gt;This is the solution provided by the Mailchimp people:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Regarding the use of commas in a group name, we would recommend removing these
commas if at all possible. We have passed this issue onto our developers for
investigation. At this time we do not have an estimated time frame of when we
will be able to hear back from them. However, we will continue to investigate
and push a resolution as soon as one becomes available if our developers do
believe this to be necessary. At this time, removing all commas from the group
names and creating an ELSE statement would be our top ideas!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Awesome!&lt;/p&gt;
&lt;p&gt;Of course, you’re probably eager to hear about the Drupal bit of my
Mailchimp adventures. Well, stay tuned. I’ve been toying with the
Mailchimp API. And I like it. A lot. I’ve chalked up a few ideas.
I’m going to let them stew a little bit longer until I’ve got a
clear head about what is feasible.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>