Can't create new campaigns with non existing segmentation rules

Created on 14 May 2019, about 6 years ago
Updated 10 July 2025, 16 days ago

The new V3 API no longer provides ability to test segmentation options for new campaigns (v2 example campaignSegmentTest). Right now in latest 7.x version we have in mailchimp_campaign_save_campaign method on line 320

  // Test for valid list segment, if selected.
  if (isset($recipients->segment_opts)) {
    if (mailchimp_test_list_segment($recipients->list_id, $recipients->segment_opts->saved_segment_id) === NULL) {
      return NULL;
    }
  }

which will check only existing segment and stop us to create a new segmentation rules from API when segment_opts is set. As the docs say for segment_opts parameter:

This object should contain a saved_segment_id to use an existing segment, or you can create a new segment by including both match and conditions options.

For reference you can check https://developer.mailchimp.com/documentation/mailchimp/reference/campai... so when we set match and condition options the check from line 320 will fail and campaign will not be saved. I am not really into mailchimp API so I can't propose viable alternative but it seems like there is no substitute for campaignSegmentTest method right now. In all cases above check must be adjusted or removed.

🐛 Bug report
Status

Closed: won't fix

Version

5.0

Component

General

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States xenophyle

    Thanks for submitting this ticket — and sorry we didn’t get back to you about it sooner. We are cleaning up old issues and issue for old versions and are going to close this one. If this issue is still relevant for you, please re-open it and update the “Version” field, and include any updates to the behavior you are seeing.With a smaller issue queue, we’ll have an easier time getting back to you.

Production build 0.71.5 2024