Skip to content

Add required support for interest group checkboxes to enforce server-side validation #225

Description

@grappler

Is your enhancement related to a problem? Please describe.

I use this plugin as a newsletter signup form on a WordPress site and I would like interest group checkboxes to support a "required" attribute so that form submission is blocked when a specified group checkbox is left unchecked.

Currently, the plugin's required validation only applies to merge fields (e.g. address). Interest group checkboxes — even when left unchecked — do not prevent form submission. This makes it impossible to enforce a GDPR consent checkbox backed by an interest group without custom workarounds. A user can submit the form without checking the consent box, complete the double opt-in flow, and be subscribed with no server-side record that consent was given.

Designs

No mockups provided. The expected behaviour is identical to existing merge field required validation: if a required interest group checkbox is unchecked on form submission, the form returns a localised error message and does not subscribe the user.

Describe alternatives you've considered

I have also considered a JavaScript-only solution that disables the submit button until the checkbox is checked. However, JS-only validation provides no server-side guarantee and can be bypassed, which is insufficient for demonstrable GDPR consent records. A server-side hook (e.g. inside prepare_groups_body() or a new filter before subscribe_to_list() is called) is needed to make this watertight.

I have also considered using the plugin's native GDPR fields feature, but this is not available in the official WordPress plugin — only in Mailchimp's own hosted and embedded forms.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions