Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Setup An RSS-Based Campaign

Video loading...

  • 0:02
    Using MailChimp with Drupal 7
  • 0:04
    Set Up an RSS-Based Campaign Series Sponsored by MailChimp
  • 0:09
    MailChimp offers us the ability to set up RSS-based email campaigns
  • 0:14
    that automatically send daily, weekly or monthly emails to your subscribers
  • 0:19
    based on the content of an RSS feed. It's really cool because in a way it allows us
  • 0:24
    to automate some of the process of sending out our email newsletter,
  • 0:27
    because MailChimp can just read in the content that we've already entered into our website
  • 0:31
    and generate a newsletter based on it. In this tutorial we'll look at creating
  • 0:35
    an RSS feed of ice cream flavors in our Drupal site, using Views.
  • 0:41
    And then, we'll configure a MailChimp campaign to use the content of that RSS feed
  • 0:46
    to send a daily email to anyone subscribed to our flavor of the day list.
  • 0:51
    Now, this tutorial is about MailChimp and not Views, so I'm going to assume
  • 0:55
    that you've already got the skills to be able to create a View that is an RSS feed.
  • 1:00
    If you don't, I'll link to a tutorial in the notes for this video, that will help you with additional
  • 1:06
    information on creating this RSS feed. By the end of this tutorial, you should
  • 1:10
    be able to create a campaign in MailChimp that pulls data from an RSS feed in Drupal
  • 1:14
    and sends an email with the data to your mailing list on a regular basis.
  • 1:19
    A couple of things about the setup that we're working with, here. First off, it's important to note
  • 1:23
    that this site is available and accessible to the internet.
  • 1:27
    It's not on my local host anymore. This is important because MailChimp
  • 1:32
    is going to need to be able to access our RSS feed.
  • 1:35
    So, for demonstration purposes, I've created a demo site on Pantheon
  • 1:41
    that we'll use for this. In my demo site, I created
  • 1:44
    a new content type, so if I go Add content, and then Flavor, you'll see I've got
  • 1:50
    a content type named Flavor that just has a Title field and a Body field, nothing special.
  • 1:55
    But I wanted to show you that, as well as a View.
  • 1:59
    So, down here on the left, I've got the Flavor of the Day link, which takes us to
  • 2:05
    a View, this is a View of all the flavors, sorted by Most Recent ones first,
  • 2:11
    and down at the bottom of this is a link to an RSS feed.
  • 2:16
    This RSS feed was generated by Views. You click on that and you can see the
  • 2:21
    XML that represents our Flavor of the Day RSS feed.
  • 2:24
    So, I'm going to need this in the MailChimp. Now, what I'm gonna do is switch over to
  • 2:30
    MailChimp, and I'm going to create a new campaign based on that
  • 2:34
    Flavor of the Day RSS feed. So, the first thing I'll do is
  • 2:38
    click Create Campaign. On MailChimp under the
  • 2:40
    Campaigns Tab you click Create Campaign.
  • 2:42
    From the list of options here, I'm going to choose RSS-Driven Campaign.
  • 2:46
    So I'll click Select. I need to add the RSS Feed URL,
  • 2:50
    so, back on my Drupal site I can just copy and paste
  • 2:54
    the link to that RSS Feed that exists in Views, and I'll paste that into MailChimp, like so.
  • 3:00
    It asks me questions: when should we send? Everyday? At what time?
  • 3:04
    Only if there's new content? Ours is a Flavor of the Day update,
  • 3:08
    and we'll send it... maybe in the afternoon, since people probably want to stop by
  • 3:12
    and get some ice cream after work, we'll send them a reminder around 3 o'clock
  • 3:16
    and remind them that maybe they should stop and get some ice cream on the way home,
  • 3:19
    try out our new flavors. And we'll send it every day of the week,
  • 3:22
    though we could decide, if there were certain days that we didn't want to send it,
  • 3:26
    to not send it on those days. So now I'm going to click Next.
  • 3:30
    As part of creating an RSS-based campaign you need to choose the list that you want
  • 3:33
    to send this to. We're going to send it to
  • 3:35
    our Daily Flavor Updates list, and we'll just send it to the entire list.
  • 3:40
    Name our campaign—we'll call it Flavor of the Day.
  • 3:44
    The subject... you can see here, and this hints at what we're going to be using later on
  • 3:49
    in the campaign, is that MailChimp has RSS feed merge tags.
  • 3:56
    Similar to merge tags that we've seen before, these are basically tokens that will be replaced
  • 4:00
    with the information that MailChimp has extracted from our RSS Feed.
  • 4:04
    In this case the title and the date, just so can you use that for the subject.
  • 4:09
    We'll remove Title, like so. We'll leave Date, though,
  • 4:13
    and we can say: Anytown Ice Cream Flavor for,
  • 4:20
    Flavors for... DATE. So now, everyday
  • 4:24
    people subscribe to the list, we'll get an email in their inbox
  • 4:27
    with the subject line: Anytown Ice Cream Flavors for-
  • 4:30
    and then today's date. We'll leave the From name
  • 4:33
    and From email address as they are, that's just fine, everything else in fact
  • 4:36
    we'll leave as is. For this particular one
  • 4:40
    we're more interested in setting up the RSS aspects of it.
  • 4:43
    So we'll scroll down and click Next. We can choose from all the templates,
  • 4:47
    we'll just use this basic 1-column template in our use case here.
  • 4:51
    So we'll select that. You know, keep it interesting,
  • 4:53
    we can add an image at the top. So let's go ahead and pick an image.
  • 4:57
    We'll add the image of our ice cream shop. So, that appears at the top.
  • 5:02
    MailChimp really likes it if you edit this top left summary here, so we'll say:
  • 5:09
    Daily Flavor... in fact, if you don't edit this summary during the final
  • 5:13
    scan of your campaign, MailChimp will issue a warning, letting you know
  • 5:18
    you might want to replace the default text that we inserted into that template.
  • 5:21
    Anyways, we've gone ahead and done that. Now, if I scroll down to the content section
  • 5:26
    of this template, what I'd like to do here is edit this content section, and instead of
  • 5:32
    having it list whatever content someone filled out that day or for that campaign,
  • 5:37
    we're going to insert the items that are extracted from the RSS Feed that we gave
  • 5:43
    to MailChimp to read. We can change the title here
  • 5:46
    and we can say, Flavor of the Day, and then we can delete all of the
  • 5:50
    existing content, like so. But what do we put in place of it?
  • 5:55
    This is where RSS merge tags come into play. If we take a look at the
  • 5:59
    documentation for merge tags on, which I'll link to
  • 6:04
    in the notes for this video, there are a ton of merge tags
  • 6:08
    that you can use when creating templates or campaigns.
  • 6:11
    In our case we're specifically interested in the merge tags for RSS-driven campaigns,
  • 6:16
    so I'll jump to that section of the documentation.
  • 6:18
    These are helpful for when you're pulling in data from an RSS feed
  • 6:22
    and you'd like to insert the dynamic content into the campaign.
  • 6:27
    In our use case, we're specifically interested in RSS items.
  • 6:31
    Pre-formatted RSS tags are basically just "insert a single tag here"
  • 6:35
    and it'll extract a teaser and insert the teaser. RSS channel tags refer to things like the
  • 6:42
    title of the RSS feed, the date, etc. So they're a little... they're more global
  • 6:46
    for the RSS feed, and then RSS item tags are the tags that are available for each
  • 6:51
    specific item. I'm going to click on that
  • 6:54
    and then I can read through the documentation here.
  • 6:57
    Basically, what it tells me, is that there's an RSS Items tag that looks
  • 7:01
    like this. If I use this tag, it actually creates basically a loop inside of our
  • 7:06
    template, and it'll continue to loop over this RSS items section in our
  • 7:11
    template, for each new item that is found in the RSS Feed.
  • 7:16
    For these loop style tags, you need to have a start and an end, so we have RSS items
  • 7:21
    and then end RSS items. So, in our template, let's add
  • 7:28
    those tags. So I'm going to add the RSS Items tag, like so, then I'll
  • 7:32
    also copy and paste the end RSS items tag, like so. So now, for every new item in our
  • 7:40
    RSS feed, whatever's in between these two tags will get printed out.
  • 7:45
    So, what I want, is something that looks like this: Title, Flavor, we'll call it
  • 7:49
    say Flavor, Description. Except, I want the data that's
  • 7:55
    extracted from the RSS feed, so, back to the documentation,
  • 7:59
    if you continue reading down the list here, you'll see there is RSS item tags
  • 8:04
    for Title, URL, Date, Author, Categories, there's a whole bunch of them here,
  • 8:10
    Content, Content Full,Content Text, which is the plain text version
  • 8:15
    of the content. Each of these are things
  • 8:17
    that MailChimp is able to extract from a standard RSS feed.
  • 8:21
    The two that we're interested in are Title and Content_Text.
  • 8:26
    So, I'm going to switch back over to our template, and I'll replace Description
  • 8:30
    with this RSSITEM:CONTENT_TEXT and then this one was TITLE.
  • 8:39
    And maybe we'll make the title bold. And then we want to make sure that
  • 8:43
    there's an extra space below, maybe we should insert a style
  • 8:47
    of some sort that makes it obvious, so, like a horizontal rule, like so.
  • 8:51
    So that will split each item by inserting a horizontal rule in between each of them.
  • 8:56
    Let's confirm that this is working. I can do so by clicking on
  • 9:00
    Preview and Test. So Preview and Test
  • 9:03
    and we'll go to Enter Preview mode. And if I scroll down and look at the preview
  • 9:07
    you can see that it's extracted one item from our RSS feed.
  • 9:13
    If there are more than one, it would have looped over
  • 9:15
    each of them and displayed them individually with a horizontal rule
  • 9:19
    in between. In our case, there's just one for today, so it's just displaying
  • 9:22
    that one, but it's automatically grabbing that content from the
  • 9:26
    RSS feed. That's awesome. Once I'm happy with the way
  • 9:30
    my preview looks I can click Save and Close for the main
  • 9:34
    content region, and then click Next. And then I can go and schedule
  • 9:38
    this campaign to start sending whenever there's new content.
  • 9:43
    This is a warning that my list has zero people subscribed to it, so it's not
  • 9:48
    actually going to send to anyone but I'm not going to worry about that for now.
  • 9:51
    What I am going to do is, up at the top click Save and Exit, now exit to the
  • 9:58
    campaigns. Now we've got this Flavor of the Day RSS-driven campaign
  • 10:03
    listed here. These ones are, unlike the ones we've sent before, where
  • 10:07
    you just send the campaign once and people receive an email,
  • 10:11
    RSS-driven campaigns will continue to send over and over on schedule.
  • 10:16
    So, the next one is going to send tomorrow at 3 pm. But you do have the option to
  • 10:21
    pause these RSS-based campaigns and make changes to them.
  • 10:26
    In this tutorial, we looked at ways to sort of automate the campaigns that
  • 10:30
    we're sending with MailChimp. We've got an RSS feed in our
  • 10:33
    Drupal site that lists the Flavor of the Day content that editors add to the site.
  • 10:39
    And so we're able to configure MailChimp to read that RSS feed and send out a daily
  • 10:44
    email with the information that it extracts from that feed.
  • 10:48
    In order to do that, we created a new campaign, and then in our template
  • 10:52
    for the campaign, we used RSS merge fields which allowed us to put in place holders
  • 10:58
    that can be replaced with the dynamic values that MailChimp reads from the
  • 11:02
    RSS feed that we're providing in Drupal. This is a great way to automate some of the
  • 11:06
    tasks of sending things like daily reminders to users of your site or subscribers to your
  • 11:13
    MailChimp-based mailing list.

Set Up an RSS-Based Campaign


MailChimp offers the ability to set up RSS-based email campaigns that automatically send daily, weekly, or monthly emails to your subscribers based on the content of an RSS feed. In this tutorial we'll look at creating an RSS feed of ice cream flavor updates in Drupal using Views, and then configuring a campaign in MailChimp to use the content of that RSS feed to send a daily email to anyone subscribed to our Flavor of the Day list.

I'm not going to cover creating an RSS feed in Views during this tutorial. Instead I assume that you've already created the necessary feed on your own site. If you’re not familiar with creating feeds with Views check out this video tutorial, Creating Views Attachments, which demonstrates how to create an RSS feed in Views.

In order for your RSS-based campaign to work, your Drupal site needs to accessible to the web, so that when MailChimp tries to read the content of your RSS feed, it can do so. If you're just testing this out, you can use a tool like, or just create a dev site on Pantheon or Acquia to play with.

By the end of this tutorial you should be able to create a campaign in MailChimp that pulls data from an RSS feed in Drupal and sends an email with that data to your mailing list on a regular basis.

Further your learning

  • Give an example of a use case for RSS-based campaigns that would be useful for your users.
  • What do you need to do on the Drupal side of things in order to create an RSS-based campaign?
  • Can you send an RSS-based campaign to a segment of a MailChimp list?
  • Can you test an RSS-based campaign with a Drupal site on your localhost?
  • Further exploration: Can you add an RSS feed to a regular campaign template? Hint: *|RSSFEEDBLOCK|*

Series Sponsored by MailChimp

Log in or sign up to download companion files.