-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form submitted even if opt-in checkbox is unchecked #79
Comments
Experiencing the same behavior here. Is this still maintained? Signing people up when they haven't opted in is a major enough bug that it renders the plugin useless (or at least unethical). For those of us who must still make this work regardless, I managed to find a workaround:
The big downside is that if you happen to modify and re-save the form, this edit disappears. The bug seems to be that when a checkbox field is not specified (when a shortcode is used rather than a native Contact Form 7 field) this option does not get properly updated from the plugin. It only gets updated if an "Opt-In Field" gets selected on the Constant Contact tab. Then later in the code (cf7-constantcontact.php lines 770-780) it uses this flawed "accept" option in logic: if empty, it assumes there is no opt-in field and sends the contact to Constant Contact. |
Maybe not the most ideal way to fix this, but it does prevent the 'single' checkbox type from subscribing people who didn't opt in. Does not affect the other types, although the dropdown select never did work due to a different bug. A better way to fix this might be to add 'ctctcf7_lists' to the 'Opt-In Field' dropdown list on the Constant Contact tab, but I haven't yet found where to add that - maybe something the plugin author can address more adequately.
Not sure if the above fix will be accepted - it isn't "production" quality, but if anybody absolutely needs this to work in a pinch, adding those 3 lines of code should do the trick while we wait for an official update. It modifies how the plugin saves its 'accept' config variable so that if the 'single checkbox' Opt-In method is used, it still knows which field to check. |
Another suggested workaround... It doesn't seem to have a problem when you give the user multiple lists to choose from. So, you can trick it by setting it up as if the user is subscribing to multiple lists, but you only give them a single option. The original form input would look something like this: Original code for single list opt-in:
Modified, making the checkbox checked by default, changing type to "checkboxes", and replacing the name of the list with the text you want to display. The actual name of the list doesn't seem to matter, but the ID does.
This does generate an |
Forms are submitted even if the opt-in checkbox is unchecked. Adding an * doesn't help.
Same issue is reported by soneone else here: https://wordpress.org/support/topic/opt-in-field-with-checkbox-is-not-working/
The text was updated successfully, but these errors were encountered: