Can't set default value if in profile

Created on 2 March 2023, over 1 year ago
Updated 3 March 2023, over 1 year ago

Problem/Motivation

We'd like to default the "subscribe" checkbox to being 'checked' (an opt-out approach). This works when the checkbox is on the user settings form / registration form, but when used on a "profile" the checkbox is being overridden by the current state of a user on the list. If a new registrant in the site is not already subscribed to the Mailchimp list, the box is unchecked on their initial profile configuration.

Because the email address mergevar is attached to an entity that already exists (the profile "owner", even though the profile doesn't exist yet), the user is referenced and their current subscription status overrides the desired default.

Steps to reproduce

Add a mailchimp subscription checkbox, defaulted to "checked" on a user profile, but use the profile owner's email address as the email mergevar. A new user who is not currently subscribed to the list will not have the box checked by default.

Important Note: I've attached two related issues that provide some context. Initially when trying to set the user's email as the mergevar but keep the checkbox on a profile page, I got the fatal error noted in πŸ› PHP message: Uncaught PHP Exception InvalidArgumentException: Field uid:entity:mail is unknown Closed: duplicate , so I applied the patch from πŸ› mailchimp_lists_load_email fails to find email address field when attached to a related entity. Needs work . It could be that that patch is introducing this problem and that may be a better place to deal with it.

πŸ› Bug report
Status

Active

Version

2.0

Component

Lists Module

Created by

πŸ‡ΊπŸ‡ΈUnited States matthensley Portland, OR

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

Comments & Activities

Production build 0.71.5 2024