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.

Create Your First Mailing List and Sign Up Form

Video loading...

  • 0:02
    Using MailChimp with Drupal 7
  • 0:04
    Create Your First Mailing List and Sign Up Form Series Sponsored by MailChimp
  • 0:09
    Mailing lists are at the core of all things MailChimp.
  • 0:12
    Lists allow you to gather a database of email addresses
  • 0:16
    and other additional information by asking people to subscribe to your list.
  • 0:20
    Once subscribed, or added to a list by other means,
  • 0:23
    addresses can be sent emails.
  • 0:26
    MailChimp lists allow users to manage their own subscriptions
  • 0:30
    and to easily opt out as desired.
  • 0:33
    In this tutorial, we're going to start out by creating a new list
  • 0:37
  • 0:39
    That'll be a point where we can collect contact information.
  • 0:42
    Once that list is created on MailChimp,
  • 0:45
    we'll enable a couple of modules on the Drupal side,
  • 0:48
    which will allow us to import the list configuration
  • 0:51
    from MailChimp into Drupal
  • 0:53
    and to then create a sign-up form on our Drupal site.
  • 0:57
    We'll look at creating a signup form as a standalone page
  • 1:01
    and a signup form that can be placed in a block.
  • 1:03
    These signup forms will allow any user of our site
  • 1:07
    to fill out the form and subscribe to our mailing list.
  • 1:10
    In this tutorial, I'm assuming that you've already got
  • 1:13
    the MailChimp module installed and configured to use
  • 1:16
    your API key for your MailChimp account.
  • 1:19
    If you don't, take a look at the tutorial in this series
  • 1:23
    that covers adding an API key to your Drupal installation.
  • 1:27
    By the end of this tutorial, you should be able to create
  • 1:30
    a MailChimp list and allow people to subscribe to that list
  • 1:33
    via your Drupal site.
  • 1:35
    Let's go ahead and get started.
  • 1:37
    So, the first thing that we're going to do is create a list on
  • 1:40
    If you're not already logged in, you can go to
  • 1:46
    and enter in your user name and password that you created
  • 1:48
    in the previous tutorial.
  • 1:50
    Once you're logged in, you get a bunch of tabs across the top here.
  • 1:53
    The one that we're interested in right now is Lists.
  • 1:56
    So I'm going to click on the Lists tab— it helpfully tells me
  • 2:00
    that I don't currently have any lists and points at the link
  • 2:03
    for create a new list, so that's what I'm going to do.
  • 2:05
    I'm going to create a new list, and I need to give MailChimp
  • 2:09
    some information about this list.
  • 2:11
    So, we're going to create one called "Weekly Newsletter",
  • 2:14
    so this will be for anyone that would like to receive
  • 2:17
    a weekly email about goings-on at our ice cream shop.
  • 2:21
    You need to enter a from address and a from name,
  • 2:24
    so we'll just make this the from name,
  • 2:30
    like so.
  • 2:32
    The email address that these emails are going to be sent from
  • 2:34
    whenever you're sending to this list, and then the name
  • 2:38
    that will appear alongside of the email address
  • 2:40
    as the person who sent it.
  • 2:44
    MailChimp recommends that you add a reminder for people
  • 2:46
    for how they got on your list, sort of a "Why am I getting this email?"
  • 2:51
    So when I sent a campaign out to the entire list,
  • 2:54
    there's a reminder for them— like, this is the list
  • 2:56
    that you subscribed for, and why. We'll put it like that.
  • 2:59
    Fix spelling.
  • 3:03
    And then the contact information— I entered this
  • 3:06
    when I created my account— what this information is for,
  • 3:09
    and I can edit it here, so that whenever I send emails to this list,
  • 3:13
    it will also attach this information in the footer of emails.
  • 3:17
    This is in order to comply with regulations
  • 3:19
    around bulk email, and it also just helps ensure
  • 3:23
    a sense of security and confidence in the people that we're emailing
  • 3:26
    when they can see that this is coming from a person and they know
  • 3:30
    who that person or that individual is.
  • 3:32
    Finally, I can opt to receive email notifications
  • 3:37
    from MailChimp about activity that takes place on a list.
  • 3:41
    I'm not going to sign up for any of these right now,
  • 3:43
    because this is just for a demo, but I do, occasionally,
  • 3:45
    when I'm working on these, I like to sign up for a daily summary,
  • 3:48
    and what that will do is send me an email once a day
  • 3:51
    telling me about who all of my new subscribers are to a list
  • 3:55
    or who has unsubscribed from my list.
  • 3:57
    And you can also do it every time someone subscribes
  • 4:00
    or every time someone unsubscribes.
  • 4:02
    I find that gets a little bit noisy, so I like to use the daily summary, generally.
  • 4:06
    So I'll save that, so I've now got a new list
  • 4:10
    called Weekly Newsletter.
  • 4:12
    It doesn't currently have any subscribers— we'll work on that in a moment.
  • 4:15
    But with each list, I get some additional options here.
  • 4:18
    To demonstrate where this is in the MailChimp UI,
  • 4:21
    if I click on the Lists tab, now where before,
  • 4:25
    this was an empty page, I now see I've got
  • 4:28
    a Weekly Newsletter list, then I can click on that
  • 4:30
    to get back here where we just were after creating it,
  • 4:34
    which shows the list of subscribers.
  • 4:36
    There's an option to add subscribers. I can also view statistics from my list.
  • 4:40
    There's really not going to be any statistics at the moment.
  • 4:43
    And then additional list settings.
  • 4:46
    You can come back and edit any of the things
  • 4:50
    that we just set, so the name of the list, the default email and so forth
  • 4:53
    can all be changed.
  • 4:55
    We can add additional merge fields to a list,
  • 4:57
    so when somebody subscribes to a list,
  • 4:59
    is there other information other than just their email address
  • 5:03
    that we'd like to collect?
  • 5:05
    We'll come back and look at this in a different tutorial,
  • 5:07
    and there's also a couple of other settings that we can look at here as well.
  • 5:12
    There's also, finally, this signup forms option,
  • 5:16
    which allows you to create HTML forms
  • 5:20
    that you can embed into your code
  • 5:22
    by copying and pasting them from the MailChimp UI.
  • 5:25
    This is one way that we could create a signup form on our Drupal site
  • 5:29
    is by coming here and using one of these embeddable forms
  • 5:32
    and just copying and pasting the HTML
  • 5:34
    right into a template file in our theme, for example.
  • 5:36
    However, we're going to look at using the MailChimp Integration module
  • 5:42
    to create a signup form.
  • 5:44
    So let's switch back over to our Drupal site.
  • 5:46
    Over on my Drupal site, I need to enable
  • 5:49
    a couple of modules in order to allow this to happen.
  • 5:52
    On the Modules page, I'm going to scroll down
  • 5:54
    to the list of MailChimp modules, which is towards the bottom here,
  • 5:57
    and I'm going to select MailChimp Signup.
  • 5:59
    This allows us to manage MailChimp signup blocks and pages.
  • 6:04
    When I enable this, it's also going to enable
  • 6:06
    the Entity API module, which is a dependency
  • 6:09
    of the MailChimp Signup module.
  • 6:11
    So I'll go ahead and do that.
  • 6:14
    Just go ahead, enable those dependencies.
  • 6:17
    I can scroll down and confirm that this was enabled.
  • 6:21
    So I've got MailChimp Signup— confirm that it's enabled.
  • 6:24
    I can click here to see the permissions that this module offers,
  • 6:27
    so if I click on Permissions, you can see
  • 6:30
    that the module adds two new permissions,
  • 6:33
    one of which is Administer MailChimp Signup Entities,
  • 6:38
    so anyone that has this permission will be able to create new forms
  • 6:42
    for users to sign up for a list on our site,
  • 6:46
    and then Access all MailChimp Signup Pages.
  • 6:49
    This controls who can access a page
  • 6:52
    and sign up for a list—
  • 6:54
    we'll go ahead and say anybody that wants to
  • 6:57
    can access a page and sign up for a mailing list.
  • 7:00
    I'll make that change and click Save.
  • 7:04
    Then, if I go to Configuration, and I scroll down
  • 7:09
    under Web Services and click on MailChimp,
  • 7:12
    you'll notice now that there's a Signup Forms tab here
  • 7:16
    that wasn't here before— this is provided by the module
  • 7:18
    we just enabled, so I'll go there.
  • 7:20
    From here, I can create any number of signup forms.
  • 7:25
    We're just going to create one to start out with
  • 7:28
    and demonstrate how it all works, but this is the UI for doing that.
  • 7:31
    So I have Add MailChimp signup form and Import MailChimp signup form.
  • 7:35
    This kind of alludes to the fact that these signup forms
  • 7:38
    that we're creating are essentially a configuration,
  • 7:40
    and that configuration can be exported, either into another module
  • 7:44
    or into a feature, if you're using the Features module.
  • 7:48
    So once you've created that configuration,
  • 7:50
    there are various ways to share it with other people
  • 7:54
    or to embed it into the code that makes up your application.
  • 7:58
    Anyways, we're going to click on Add MailChimp signup,
  • 8:02
    and then we need to add a little bit of additional information here.
  • 8:05
    So the title for this signup form, we'll call it Mailing List Signup.
  • 8:09
    You can leave the description blank or we could enter
  • 8:12
    some additional information here if we wanted to.
  • 8:14
    So we've got a description there— Display Mode, required field.
  • 8:18
    You have two options— Block and/or Page.
  • 8:22
    We'll do both so we can see what they both look like.
  • 8:25
    So I'm going to select Block and Page.
  • 8:27
    When I click Page here, you'll see that it added
  • 8:29
    one more required field under Settings.
  • 8:31
    That's going to be the URL at which this form can be observed.
  • 8:36
    So by choosing Display Mode, Block or Page,
  • 8:39
    I'm determining, should the form that we're creating
  • 8:41
    be displayed in a block or should it be displayed in a page or both?
  • 8:44
    And then here's some additional configuration
  • 8:47
    for when you're displaying that form.
  • 8:49
    What's the URL that you would like to use?
  • 8:52
    So newsletter—we'll just use the example that they've got here—
  • 8:55
    that works great for me, so newsletter/signup.
  • 8:58
    There's going to be a Submit button that somebody clicks—
  • 9:02
    maybe I'll rename this to Subscribe instead of Submit.
  • 9:05
    A confirmation message that's displayed when someone
  • 9:09
    fills out the form, and optionally,
  • 9:11
    if you would like to, when somebody submits the form,
  • 9:15
    you can redirect them to another page.
  • 9:17
    So you might have a Thanks page altogether
  • 9:20
    rather than just a confirmation message.
  • 9:22
    We'll leave that as is.
  • 9:24
    MailChimp List Selection allows you to choose
  • 9:28
    which of the lists that you've currently got configured
  • 9:32
    in MailChimp should this form synchronize with.
  • 9:35
    So when somebody fills out the form, which list should it send its data to?
  • 9:40
    We're going to say the Weekly Newsletter list,
  • 9:42
    because that's the only one we've got right now.
  • 9:44
    By default, when we created that list in MailChimp,
  • 9:46
    MailChimp added two additional merge fields,
  • 9:49
    First Name and Last Name.
  • 9:51
    The Drupal module gives us the option to add an extra text field
  • 9:55
    on the form for any merge field.
  • 9:57
    Email address, of course, is required to sign up for a list.
  • 10:00
    First name and last name are optional here.
  • 10:03
    I could disable the fields if I want to.
  • 10:05
    I'm going to leave them enabled, and then some additional settings
  • 10:08
    that change the behavior for when someone signs up for a list.
  • 10:13
    Are you requiring your subscribers to double opt in?
  • 10:16
    So after they fill out the form to sign up,
  • 10:20
    MailChimp will send them an email with an activation link
  • 10:22
    that they need to click on.
  • 10:24
    Do you want to send a welcome email to new subscribers,
  • 10:26
    and/or do you want to include interest groups on the subscription form?
  • 10:30
    These configuration options are all toggling on or off
  • 10:35
    features provided by MailChimp, so the opt-in email
  • 10:40
    and the welcome email and the text for those
  • 10:42
    is all configured in the MailChimp UI, and you're just selecting here
  • 10:45
    would you like to enable that feature or not.
  • 10:48
    We'll just leave it as-is, and click Save.
  • 10:50
    So I've now configured a new mailing list signup form
  • 10:55
    using the MailChimp Signup module, and you can see it listed here.
  • 10:59
    I could edit it if I want to; I could clone it and create a new one,
  • 11:02
    export it, whatever the case may be.
  • 11:05
    What I want to do is show how this works.
  • 11:07
    So I can click right here on Page under Display Modes,
  • 11:11
    and it'll take me to the form that we just created.
  • 11:14
    So we're at Mailing List Signup form,
  • 11:16
    which is at the URL/newsletters/signup.
  • 11:20
    I can enter in an email address here—
  • 11:22
    we'll just enter in a test email address.
  • 11:26
    One thing to be aware of when you're testing things
  • 11:28
    with MailChimp is that it does not like emails.
  • 11:33
    So you actually do need to use a valid email.
  • 11:36
    It respects plus addressing, like this, though,
  • 11:38
    so I can pretty easily use my own email address
  • 11:41
    and just keep using it over and over
  • 11:43
    and add plus some random characters.
  • 11:45
    [Mailing List Signup] And we'll say this
  • 11:48
    is first name Joe, last name Test123.
  • 11:52
    Click Subscribe.
  • 11:54
    You've been successfully subscribed— that's the conformation message
  • 11:58
    that we configured when we created this signup form,
  • 12:00
    so that works. Let's switch over to MailChimp real quick.
  • 12:04
    So back over on the site,
  • 12:09
    I can go to Lists and select my Weekly Newsletter List,
  • 12:14
    and I can see that, indeed, this email address,
  • 12:17
    which we just filled out on our form in Drupal,
  • 12:19
    has been subscribed to our list.
  • 12:21
    Just a heads up that it can take a few minutes
  • 12:25
    for MailChimp to process these subscriptions,
  • 12:27
    so if you filled out the form on your Drupal site
  • 12:30
    and then switched over to MailChimp right away,
  • 12:32
    the subscriptions might not be there yet,
  • 12:35
    but if you come back in like five or ten minutes
  • 12:37
    and hit Refresh, they should show up.
  • 12:39
    Awesome, so that worked out great.
  • 12:42
    As long as I'm here, I'm going to create one other new list.
  • 12:46
    So I'm going to go to Lists and Create a List.
  • 12:50
    I'm going to say Create a New List.
  • 12:53
    Same as before, I'm going to fill out the form.
  • 12:55
    This one's going to be for our Daily Flavor Updates.
  • 12:58
    So this is a list of people who have subscribed
  • 13:00
    who would like to receive daily updates from us
  • 13:03
    about which flavors are currently available in our ice cream shop.
  • 13:08
    So nothing new here— we've done this before.
  • 13:11
    I'm creating a second list so I can demonstrate
  • 13:14
    what this will look like over on the Drupal side.
  • 13:16
    So now I've got two lists.
  • 13:18
    If I flip back over to our Drupal site
  • 13:21
    and I go to Configuration, MailChimp, under Web Services,
  • 13:25
    and then click the Signup Forms link again,
  • 13:28
    I can edit our existing signup form
  • 13:31
    and scroll down, and you'll notice that there are now two lists here
  • 13:36
    that people could subscribe to.
  • 13:38
    I can either check this again— so Daily Flavor Updates
  • 13:42
    and Weekly Newsletter, to allow people to choose
  • 13:45
    to subscribe to both of these lists,
  • 13:48
    or I could create a new signup form that's specific
  • 13:51
    to the list we just created.
  • 13:53
    I'm going to say Show Daily Flavor Updates
  • 13:56
    and Weekly Newsletter as Options, click Save.
  • 13:59
    If I navigate back to our page, you'll now see
  • 14:02
    that whenever someone navigates to my site
  • 14:04
    and the page for the signup form here, they have the option to choose
  • 14:08
    either the Daily Flavor Updates or the Weekly Newsletter, or both.
  • 14:13
    Finally, if we navigate to Structure
  • 14:16
    and then Blocks, under the Disabled Blocks section,
  • 14:21
    we should be able to find a MailChimp Subscription Form block
  • 14:24
    that has then the name that we configured for that form.
  • 14:27
    So the MailChimp signup module— for every signup form
  • 14:31
    that we create and check the Block Display Mode
  • 14:34
    will create a new block here in the Block Administration Interface
  • 14:37
    that we can place into any region on our site.
  • 14:40
    So I'm going to place this in the Sidebar First Region, like so.
  • 14:44
    You can see that it's now showing up here.
  • 14:47
    I'll leave it down at the bottom of the list and then click Save.
  • 14:51
    Then if I go to the home page of our site,
  • 14:54
    you'll see that we now have a block on the site
  • 14:57
    where users can sign up for our mailing list.
  • 15:00
    All right, so we now have the ability
  • 15:02
    for people to sign up for either or both of our two newsletters.
  • 15:07
    We accomplished this by first creating a new mailing list
  • 15:11
    on, or really,
  • 15:15
    and then over on the Drupal side,
  • 15:18
    enabling the MailChimp signup form
  • 15:21
    and creating a new signup form entity
  • 15:25
    using its configuration.
  • 15:27
    That allowed us to create a form that's displayed
  • 15:30
    either in a block or on a page, or both,
  • 15:33
    that when filled out, will allow users to subscribe
  • 15:36
    to our mailing list.
  • 15:39
    This method works great for collecting email addresses
  • 15:42
    from anonymous users.
  • 15:44
    The downside here is that once they're signed up
  • 15:47
    for our mailing list, there's really no association
  • 15:50
    between their subscription in MailChimp
  • 15:53
    and the fact that they're navigating our site in Drupal.
  • 15:57
    In the next tutorial, we'll look at how we can link
  • 16:00
    Drupal user accounts to a subscription
  • 16:03
    to a MailChimp list.

Create Your First Mailing List and Sign Up Form


Mailing lists are the heart of all things MailChimp. Lists allow us to gather a database of email address, and other additional information, by asking people to subscribe to our list or by doing so automatically based on other actions they take within our application. Once subscribed, and added to a list, these addresses can be sent emails. MailChimp lists allow users to manage their own subscriptions, and to easily opt-out as desired.

In this tutorial we'll look at creating our first list in the MailChimp UI. We'll create one for a weekly newsletter on our site. And then we'll install the MailChimp Signup module and use it to create a simple form that allows users to subscribe to our mailing list.

The MailChimp Signup module can be used to create a page with a sign up form on it by specifying the internal path for the new page and choosing which list, or lists, the sign up form should allow a user to subscribe to. In addition, you can also create a sign up form as a block. These blocks are then available to place into any region on your site via the Drupal block administration screen. This gives you a lot of flexibility when it comes to placing sign up forms. Learn more about placing blocks on your site in the Working with Blocks in Drupal 7 video lesson.

Sign up forms created using the MailChimp Signup module will work equally well for anonymous and authenticated traffic. These are a great substitute for the copy/paste HTML forms that MailChimp gives you, with some distinct advantages, like for example keeping the labels of fields up to date if they change in MailChimp without having the copy/paste a new version of the HTML form.

By the end of this tutorial you should be able to create a MailChimp list and allow people to subscribe to that list via your Drupal site.

Further your learning

  • When you create a list in MailChimp you provide some default configuration for that list. Where do you change those default settings?
  • Which of the MailChimp project's sub-modules are required to be able to create a form that will allow visitors to subscribe to a MailChimp list? (Hint: there are 2 of them).
  • What are the display modes available for a signup form created in Drupal? How do they differ?
  • Further exploration: Can you add an “Interest group" to your MailChimp list and then have it displayed on the subscription form in Drupal?

Series Sponsored by MailChimp

Log in or sign up to download companion files.