Forums

AcyMailing Newsletter Subscription Using cURL and ChronoForms v5

ozneilau 28 May, 2014
1 Likes
I'm not sure if the Curl action in ChronoForms v5 is intended to work the same way as the cURL[GH] action in ChronoForms v4 but it doesn't seem to work quite the same way.

Here is a start to finish tutorial on how I managed to enable an AcyMailing subscription using cURL in ChronoForms v5.

In my form the Newsletter subscription is optional but ticked by default:

[attachment=0]1.png[/attachment]

Here's how the Newsletter Checkbox is set up in the Designer tab:

[attachment=1]2.png[/attachment]

In the Setup tab, I have included Custom Code, Event Switcher and Curl actions to process the optional subscription:

[attachment=2]3.png[/attachment]

The Custom Code sets up the Name and Surname as one field:

[attachment=3]4.png[/attachment]

The Event Switcher checks whether the Newsletter check-box has been selected or not:

[attachment=4]5.png[/attachment]

Finally, the Curl action is set up like this:

[attachment=5]6.png[/attachment]

Notes:

1. The curly brackets don't seem to be required any more.
2. Apart from the name and email fields, I have included all the other parameters in the "Target URL" field as they didn't seem to work in the "Fields map" field.

Issues:

1. In the above example, I am concatenating two strings with a space in the middle but ChronoForms v5 does not seem able to handle the space and when I check in AcyMailing, only the first name has been added to the mailing list. I tried "%20" rather than a space but this didn't help.

It took me a while to get this far so I hope this streamlines the process for others!
ozneilau 28 May, 2014
I forgot to mention that if you have enabled Captcha in AcyMailing you also need to include the security key in the Target URL" field like this:

&seckey=12345678901234567890


You can find your security key in the AcyMailing Configuration under the security tab.
ozneilau 28 May, 2014
Update: Please ignore the issue I posted above. I worked out there is a typo in a field name in the Custom Code which should be "ParentGuardianSurname" rather than "ParentGuardianSurame".

That's what you get when you stare at the same code for too long!
GreyHead 28 May, 2014
Hi Neil,

Just as a matter of taste I prefer not to add parameters in the target URL but to pu them all in the Fields/Params box - I do understand though that the behaviour of the standard action doesn't encourage that :-(

Bob
This topic is locked and no more replies can be posted.