LifterLMS Mailchimp Integration: Sync Students by Course

Connect LifterLMS to Mailchimp with the official add-on, add students to audiences and groups by course and membership, handle consent, and add Mailchimp tags with WP Fusion, Zapier or a short plugin.

  • Add as a preferred source on Google
Illustration for “LifterLMS Mailchimp Integration: Sync Students by Course”

Once students are in Mailchimp you can welcome them, nudge them when they stall, and sell them the next course. The LifterLMS Mailchimp integration gets them there automatically, sorted by what they enrolled in, so a student of your beginner course does not get the advanced launch email meant for graduates.

This guide covers the official LifterLMS MailChimp add-on step by step, how to structure your Mailchimp audience, and how to add Mailchimp tags, which the add-on documentation does not cover, with WP Fusion, Zapier or a small custom plugin.

For the wider choice of email and CRM tools, see our roundup of LifterLMS integrations.

Your options for connecting LifterLMS to Mailchimp

OptionWhat it syncsChoose it when
LifterLMS MailChimp add-onNew users to a default audience; enrolled students to an audience and interest group per course or membership; consentYou want the official, supported route and groups are enough
WP FusionTags on enrollment, completion, quiz results and purchases; tag-based enrollmentYou need tags for many events, or may change email platform later
Zapier or similarWhatever the zap does with LifterLMS triggers and Mailchimp actionsA few simple rules, no plugins
Custom pluginExactly what you code, such as tags added and removed with enrollmentYou want tags without another subscription, under version control

The add-on and WP Fusion are paid WordPress plugins; Zapier and Mailchimp have their own plans. Check each vendor's pricing page for current costs.

Set up the LifterLMS MailChimp add-on

The add-on is installed like any LifterLMS add-on, from your LifterLMS account. Its getting started guide lists the current requirements. Then:

  1. Go to LifterLMS > Settings > Integrations and open the Mailchimp settings.
  2. Tick Enable / Disable and save.
  3. In Mailchimp, create an API key from your account's API keys page.
  4. Paste it into the API Key field and click Update Lists so the add-on loads your audiences.
  5. Choose a Default List. Every new user who registers on the site is added to it.
  6. Decide on Confirmation Emails, which turns on double opt-in for every subscription the add-on makes.
  7. Review the consent and unsubscribe messages in the same settings area, and save.

The add-on documentation notes that the API key can be defined in wp-config.php instead of the database. Do that on production, so the key is not exposed in database exports or staging copies.

Sync by course and membership

Each course and membership gets a MAILCHIMP tab in its settings with two options:

  • New Enrollment List: the audience students are added to when they enroll.
  • New Enrollment Group (optional): a Mailchimp interest group recorded for the student, so you can segment by course inside one audience.

According to the add-on documentation, new and existing students are added when they enroll. Test the enrollment routes you actually use, such as purchases, free enrollments, admin enrollments and a membership's automatic course enrollment, before relying on them. Students who enrolled before you set the add-on up are not synced until they enroll in something new, so plan a one-off import if you are adding Mailchimp to an established site.

Structure your Mailchimp audience before syncing

The most expensive mistake is a separate Mailchimp audience for every course. Mailchimp bills on the total contacts across all your audiences, so a student in three course audiences can count three times, and each audience has to be managed separately. Mailchimp's own audience best practices recommend one audience organised with tags, groups or segments.

A structure that works for most course businesses:

  • One audience as the Default List and the New Enrollment List for every course.
  • An interest group category, such as "Courses", with one group per course, set as each course's New Enrollment Group.
  • Tags for events that change over time, such as "Completed: SEO Basics" or "Membership: Pro", added by one of the methods below.

Contacts can change their own interest groups from their Mailchimp profile. Tags are internal labels that only you see. Enrollment fits either; completion, cancellation and purchase history fit tags better.

The add-on can show a consent checkbox with your message on registration, checkout and enrollment forms. Students who do not tick it are not subscribed to marketing. With Confirmation Emails on, students who consent still have to click a confirmation link from Mailchimp before they receive campaigns.

Students can also manage their Mailchimp subscription from the LifterLMS student dashboard, which saves you support tickets.

Keep a clear line between marketing and course operation. Lesson reminders, receipts and password emails come from LifterLMS and do not depend on Mailchimp consent. Our LifterLMS GDPR and privacy guide covers consent records and data requests in more depth.

Adding Mailchimp tags by course and membership

The add-on documentation describes audiences and interest groups, not tags, and does not describe what happens when a student is unenrolled. If your automations rely on tags, add them another way.

WP Fusion

WP Fusion supports Mailchimp and has a deep LifterLMS integration. According to its LifterLMS documentation, you can apply tags when a course is begun or completed, when a lesson is completed, on membership enrollment, on access plan purchase, and on quiz attempts and passes. It can also work in reverse, enrolling users when a tag is applied with "Link with Tag". It is the most complete option if email automation is central to your business. See our WP Fusion guide.

Zapier

The LifterLMS app on Zapier provides triggers such as a new course enrollment, and Mailchimp's Zapier app can add subscribers and tags. Zaps check for new data on a schedule, so expect a delay. Our guide to LifterLMS Zapier automations covers the setup and limits.

A small custom plugin

If students are already being added to your audience, by the add-on or a signup form, a few lines of code can add a tag on enrollment and switch it off when access ends. This uses the LifterLMS enrollment hooks, Mailchimp's add or remove member tags endpoint, and Action Scheduler, which ships with LifterLMS, so the API call never slows down checkout.

<?php
/**
 * Plugin Name: LLMSX Mailchimp Tags
 * Requires: define LLMSX_MC_KEY and LLMSX_MC_LIST in wp-config.php.
 */

add_action( 'llms_user_enrolled_in_course', 'llmsx_mc_tag_on', 10, 2 );
add_action( 'llms_user_added_to_membership_level', 'llmsx_mc_tag_on', 10, 2 );
function llmsx_mc_tag_on( $user_id, $post_id ) {
	as_enqueue_async_action( 'llmsx_mc_tag', array( $user_id, $post_id, 'active' ), 'llmsx' );
}

add_action( 'llms_user_removed_from_course', 'llmsx_mc_tag_off', 10, 2 );
add_action( 'llms_user_removed_from_membership', 'llmsx_mc_tag_off', 10, 2 );
function llmsx_mc_tag_off( $user_id, $post_id ) {
	as_enqueue_async_action( 'llmsx_mc_tag', array( $user_id, $post_id, 'inactive' ), 'llmsx' );
}

add_action( 'llmsx_mc_tag', 'llmsx_mc_send_tag', 10, 3 );
function llmsx_mc_send_tag( $user_id, $post_id, $status ) {
	$user = get_userdata( $user_id );
	if ( ! $user || ! defined( 'LLMSX_MC_KEY' ) || ! defined( 'LLMSX_MC_LIST' ) ) {
		return;
	}

	// Use a custom tag name if set on the course or membership.
	$tag = get_post_meta( $post_id, '_llmsx_mc_tag', true );
	if ( ! $tag ) {
		$tag = 'LMS: ' . get_the_title( $post_id );
	}

	$parts = explode( '-', LLMSX_MC_KEY );
	$dc    = end( $parts ); // Data centre, e.g. "us21".
	$url   = sprintf(
		'https://%s.api.mailchimp.com/3.0/lists/%s/members/%s/tags',
		$dc,
		LLMSX_MC_LIST,
		md5( strtolower( $user->user_email ) )
	);

	$response = wp_remote_post( $url, array(
		'timeout' => 15,
		'headers' => array(
			'Authorization' => 'Basic ' . base64_encode( 'llmsx:' . LLMSX_MC_KEY ),
			'Content-Type'  => 'application/json',
		),
		'body'    => wp_json_encode( array(
			'tags' => array( array( 'name' => $tag, 'status' => $status ) ),
		) ),
	) );

	$code = wp_remote_retrieve_response_code( $response );
	if ( 204 !== $code ) {
		// Throwing marks the action as failed in Action Scheduler's log.
		throw new Exception( sprintf( 'Mailchimp tag failed for user %d: HTTP %s', $user_id, $code ) );
	}
}

Mailchimp answers a successful tag change with 204 No Content. If the person is not in the audience yet, the call fails and the failure is visible under LifterLMS > Status > Scheduled Actions, which is where to look first when tags are missing. Tags are keyed by the email address, so a student who changes their email in LifterLMS needs it updated in Mailchimp too.

Common mistakes

  • One audience per course. Use one audience with groups and tags instead.
  • Syncing without consent. Enrolling in a course is not consent to marketing. Use the consent checkbox and keep records.
  • Assuming removal is handled. Test what happens in Mailchimp when a subscription is cancelled or access expires. If nothing changes, add a tag-off rule as above.
  • Forgetting existing students. Syncing starts with new events. Import current students once, with consent status, before you switch automations on.
  • Testing only with your own email. Your admin address is probably already in the audience. Test with a brand-new address.
  • Lists not appearing. The add-on caches lists for performance. If a new audience or group is missing, clear the cache as described in the add-on documentation and click Update Lists again.

Frequently asked questions

Does LifterLMS work with Mailchimp for free?

Not out of the box. The official integration is a paid add-on. Free routes are a Mailchimp signup form on your site, which knows nothing about enrollments, or custom code using the hooks shown above.

Can I add students to different Mailchimp groups per course?

Yes. Set a New Enrollment Group on each course or membership's MAILCHIMP tab.

Does the add-on apply Mailchimp tags?

Its documentation covers audiences and interest groups. For tags, use WP Fusion, Zapier or custom code.

Can a Mailchimp action enroll someone in a course?

Not with the MailChimp add-on. WP Fusion's Link with Tag feature, or Zapier calling the LifterLMS enrollment action, can do it.

Next steps

Sketch your audience structure first: one audience, a course interest group, and a short list of tags you will actually use in automations. Then set up the add-on on staging, enroll a test student with a fresh email address, and confirm what arrives in Mailchimp, including after you cancel their access.

If you need tags for completions and quiz results, a reliable two-way sync, or a migration from another email platform, our LifterLMS integrations service designs and builds it. Tell us how you use Mailchimp today and we will suggest the simplest setup.

Add LifterLMS Expert to your preferred sources

Add lifterlmsexpert.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

  • Add as a preferred source on Google
Free consultation

Prefer expert help over DIY?

Skip the trial and error. Get specialist LifterLMS help and ship faster.

Talk to a LifterLMS Expert Explore our services

Replies within one business day