Hi,
I found an article on the Acymailing site for how to add some custom code that will automatically add a user to an acymailing user list when they submit the form.
https://www.acyba.com/acymailing/107-acymailing-chronoform.html
What I want to do is give an option to a user to when they submit the form , whether or not they want to be added to that list. So a radio box opt-in "Yes" , then submit.
How do I make sure that custom code is only executed when the user opts-in as YES?
I found an article on the Acymailing site for how to add some custom code that will automatically add a user to an acymailing user list when they submit the form.
https://www.acyba.com/acymailing/107-acymailing-chronoform.html
What I want to do is give an option to a user to when they submit the form , whether or not they want to be added to that list. So a radio box opt-in "Yes" , then submit.
How do I make sure that custom code is only executed when the user opts-in as YES?
Use an "event switcher". Data source something along the lines of {data:mailer-opt-in} or whatever you call it. Under the events put "0,1" (without the commas) and make sure your checkbox is returning a 0 or a 1 instead of "yes" (checked value: 1 , ghost value: 0). Makes things easier.
Then under the "1" event you put your acymailing optin code.
Then under the "1" event you put your acymailing optin code.
For anyone else wondering how to use Chronoforms to subscribe someone to an Acymailing list
https://www.acyba.com/acymailing/106-acymailing-subscription-url.html
Use a CURL action, leave data source empty. URL to connect to should be yoursite.com/index.php?option=com_acymailing
Data override:
WARNING: DO NOT copy+paste from the forums, it adds in hidden formatting codes and your CURL action won't work. TYPE IT OUT MANUALLY.
https://www.acyba.com/acymailing/106-acymailing-subscription-url.html
Use a CURL action, leave data source empty. URL to connect to should be yoursite.com/index.php?option=com_acymailing
Data override:
ctrl:sub
task:optin
hiddenlists:1 <-- replace this with the ID of the list you want to subscribe them to
user[email]:{data:email}
user[name]:{data:first_name} {data:last_name}
WARNING: DO NOT copy+paste from the forums, it adds in hidden formatting codes and your CURL action won't work. TYPE IT OUT MANUALLY.
This topic is locked and no more replies can be posted.