I have been using this code which works very well on a subscription center page. User can have any number of newsletters selected but then on clicking unsubscribe all of their newsletter selections are removed. Perfect.
Only issue is if the users changes their mind and then checks a newsletter checkbox the unsubscribe field remains checked.
My skills in this area are quite limited. Is there an easy way to implement the reverse of this such that if a newsletter selection is checked after the unsubscribe the unsubscribe setting is removed?
Thanks in advance.
Solved! Go to Solution.
It would have to be more like this:
MktoForms2 :: Checkbox ↔︎ Co-dependent Checkboxes or Select - no NULL
But I’m not sure you’re taking into account what happens if you don’t have NULL as a checkbox option within the Checkboxes set (that is, to clear out their current subscriptions).
Hi Mark,
You could try to create a separate triggered smart campaign that looks for a change in that value. Something like,
Smart List Trigger: Data Value Changes -> Data Value is "BU Newsletter" and New Value is "yes" (you can also add a filter that says Unsubscribed = TRUE to make sure you are only pulling in unsubscribed people)
Flow: Unsubscribe = False
Thank you for your super quick reply, its doing exactly what I need on the codepen page. But applying the code to my page Im having an issue.
I have update the fields in the code so they are deselecting on checking unsubscribe. But the bidirectional part is not working. I cant see anywhere where I need to tweak the code. Im using checkboxes for the newsletter selection but not sure thats the issue.
Any suggestions would be very much appreciated.
thanks in advance.
Im using checkboxes for the newsletter selection but not sure thats the issue.
That’s exactly the issue, because the code is built to sync a Checkbox with one or more Selects. Not any field.
Thank you, I thought as much. And I presume its not as straight forward as switching the select and checkbox refs in the code for checkbox and checkboxes (if that is the correct text for those items)?
It would have to be more like this:
MktoForms2 :: Checkbox ↔︎ Co-dependent Checkboxes or Select - no NULL
But I’m not sure you’re taking into account what happens if you don’t have NULL as a checkbox option within the Checkboxes set (that is, to clear out their current subscriptions).
Thank you, I have got this working now and it seems to be behaving as expected in both direction, just testing further.