Forums

Chronoform and AcyMailing with cURL[GH]

cinghie 01 Mar, 2012
Hey to all,

I'm creating a form for register user to my Joomla 2.5 site with ChronoForms 4.
I am using cURL action [GH] to automatically subscribe a user to multiple newsletter's lists.
This is the code in Params/Map:

option=com_acymailing
ctrl=sub
task=optin
hiddenlists=21,22,{fieldx}
user[email]={email}

The user is successfully created and automatically inserted in the lists 21 and 22 but not in the {fieldx} that is a number (1 to 20) that depends on the select of the region.
The value of fieldx appears correctly in the debug, but not in curl.

It's possible that in hiddenlist I can not insert the value of a field?
How I can do to submit a newsletter based on that field?

This is the cURL debug:

cURL OK : the cURL function was found on this server.
cURL Target URL: http://www.mysite.com/index.php
cURL Values: option=com_acymailing&ctrl=sub&task=optin&hiddenlists=%7Bfieldx%7D%2C21%2C22&user[email]=myemail%40hosting.it
cinghie 05 Mar, 2012
I reply to my self,

as explained in this post http://www.chronoengine.com/forums.html?cont=posts&f=26&t=66172#p268481, The cURL [GH] action will accept either (a) a plain text string or (b) an input name in curly brackets - but not a combination of the two.

The solution for this tread is:

1) Add in your form an hidden field like this:
<input id="hiddenlists" type="hidden" value="" name="hiddenlists" />

2) Add an event Custom Code on Submit before the cURL[GH] Action with this code:
$form->data['hiddenlists'] = "21,22,".$fieldx; 

3) In cURL[GH] Action set the hiddenlists like this:
hiddenlists={hiddenlists}

4) Test your form

Thanks a lot to GreyHead (http://www.chronoengine.com/forums/memberlist.php?mode=viewprofile&u=270) for his help.
cinghie 05 Mar, 2012
The cURL[GH] action has been updated to fix this problem and now accept mixed text and curly brackets in the Params/Fields map box.
This topic is locked and no more replies can be posted.