Site Building

Subscribe a Drupal User Account to Your List for Drupal 7

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

Sprout Video

One of the main advantages of using the MailChimp module to integrate Drupal with MailChimp is that you can allow users of your site with a Drupal account to manage their MailChimp subscriptions right through the Drupal user interface. In this tutorial we'll look at adding a MailChimp Lists field to Drupal's user entity type and then configuring that field so that we can allow users to subscribe/unsubscribe from a MailChimp list by signing in to their account. We'll also look at how we can allow users to opt-in to a MailChimp list when they register for a new account on our Drupal site.

The MailChimp Lists module is super flexible, and allows you to create a relationship between any fieldable Drupal entity and a list in MailChimp. While we're going to be using the module exclusively with user entities there are a lot of other options available. Basically, any entity with an email address can be subscribed to a list by adding the MailChimp Lists field to the entity type, choosing the list that subscriptions should be added to, and telling the field which other property, or field, on entities of this type contains a valid email address.

By the end of this tutorial you should be able to configure your Drupal site to allow users to manage their MailChimp subscription from within Drupal. As well as allow new users to opt-in to your mailing lists when they sign up for an account.

Further your learning

  • Why does the MailChimp Lists module use a Drupal field API field to track subscriptions?
  • Can you describe the primary difference(s) between allowing users to subscribe via the MailChimp Lists module, and allowing users to subscribe via the MailChimp signup module?
  • Further exploration: What happens if you delete the account of a user who is subscribed to a MailChimp list?
  • Further exploration: Can you create a new node type that can be subscribed to a MailChimp List? Give a use case for doing so.

Series Sponsored by MailChimp

Additional resources