Provide user selectable interest groups as Webform predefined options

Created on 28 February 2019, over 6 years ago
Updated 26 November 2023, over 1 year ago

Problem/Motivation

Webform Mailchimp allows admins to select the interest groups to which users will be subscribed for a Webform by configuring them in the Webform Mailchimp handler. This means all users are subscribed to the same, preselected interest groups on every form submission.

Currently, there exists no method to expose interest groups as fields on Webforms which would allow users to select their preferred interest groups themselves.

Proposed resolution

This patch provides Mailchimp interest groups as Webform predefined options. Admins can then add fields to their Webforms that use these predefined options, and the selections made in these fields by the user map to groups in Mailchimp on form submission.

This patch builds on the idea introduced by daniyarseferov โ†’ in List Interest Groups not showing on Webform Block #6 โ†’ .

Additional benefits

  1. Webform predefined options are editable, so admins can choose which groups should be included in Drupal without having to edit the groups in Mailchimp.
  2. Groups can be imported/updated from Mailchimp using the UI.
  3. Multiple groups attached to the same Mailchimp List can be used separately in Webforms.

User interface changes

  1. A new form is added allowing admins to import and/or update predefined groups options at /admin/structure/webform/config/options/import-webform-mailchimp-options.
  2. The form in 1 is available from a new link "Import Mailchimp Groups options" added to the Webform options configuration page at Structure->Webform->Configuration->Options.
  3. A new button "Fetch Mailchimp Groups" is added to the predefined options edit form allowing admins to fetch any updates to an interest group from Mailchimp.
โœจ Feature request
Status

Needs work

Version

5.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • ๐Ÿ‡ฌ๐Ÿ‡ทGreece christiana.k Athens, Greece

    To use this patch must we also apply the patch in https://www.drupal.org/project/webform_mailchimp/issues/2896695#comment-... โ†’ ?
    I'm asking because I've installed this patch and now my webform no longer creates contacts to mailchimp.
    I have a webform with two Mailchimp options fields: one select dropdown with language selection, one checkboxes list with categories selection.
    On the mailchimp handler I have left out the interest groups unselected.
    Am I doing something wrong?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia govind.maloo

    govind.maloo โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium seutje Antwerp

    It appears the changes in the path in #15 are incorporated in the latest release, even though the release doesn't mention this issue and the status wasn't changed...

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 151s
    #497310
  • I have rerolled the patch from #15 and created a merge request. This applies to `8.x-5.x-dev`. I have not yet included the changes from #21 but will add those in by the end of week as well.

  • Thanks @mradcliffe, I should be able to address those this week as well. I also was not able to finish including all the changes from #21 yet but will have that completed by midweek before fixing the other code quality issues.

  • Pipeline finished with Failed
    2 months ago
    Total: 162s
    #509892
  • I pushed changes to merge request !11 that address all the changes from #21, except for the last bit of from darvanen's 8th note in that comment:

    Also, why add

    tags to this message in particular? Why is it a special case?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mradcliffe USA

    I added some comments in the merge request. Mainly the last commit truncated the module file so it no longer is syntactically valid i.e. it errors out.

    Edit: keeping the status at Needs work. Remember also to flip the status to Needs review if you think the merge request is ready for review again.

  • Pipeline finished with Failed
    2 months ago
    Total: 268s
    #510587
  • Pipeline finished with Success
    2 months ago
    Total: 150s
    #510593
  • Pipeline finished with Success
    about 1 month ago
    Total: 269s
    #529552
  • Pipeline finished with Success
    about 1 month ago
    Total: 143s
    #529561
  • Pipeline finished with Success
    about 1 month ago
    Total: 265s
    #529565
  • Pipeline finished with Success
    about 1 month ago
    Total: 245s
    #529570
  • Pipeline finished with Success
    about 1 month ago
    Total: 141s
    #529573
  • phpstan and phpcs errors are resolved on Merge Request !11.

Production build 0.71.5 2024