Buy Now
Sign in

Help setup Chronoforms + Acymailing

login418 , February 06 2012
L
login418
I've been working on a registration form but I'm stuck.
I have a multi checkbox in my form called "Event Interests". Each checkbox represents a different Acymailing Mail list.
When the user registers for the site, they can select 1 or more boxes and that selection gets fed to Acymailing via cURL I suppose. I have no experience with cURL and I'm willing to pay a reasonable fee for this to be set up.

Please have a look here:
http://gator1806.hostgator.com/~instylet/index.php?option=com_chronoforms&view=form&Itemid=278&lang=en
My previous post about this issue:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=9&t=65693
GreyHead
Hi login418,

Please see this post

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
login418
Thanks GH,

I read through and made a few minor changes but no results.
It's a great tutorial but at the end of the day it doesn't seem to address making a checkbox array assign users to different mail lists. Below is the debug results.



Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/instylet/public_html/administrator/components/com_chronoforms/form_actions/db_save/db_save.php on line 85

Data Array:
Array
(
[name] => Dr Spock
[username] => drspock
[email] => drspock@finbvccc.com
[password] => password
[password_confirm] => password
[phone_number] => 555-5555
[company] => Sony
[industry] => Technology
[gender] => Male
[age] => 44
[how_find_us] => Web Search
[introduced] => Other
[input_checkbox_group_32] => Fashion,Themed,Commodities
[other_interests] => Networking
[additional_comments] => none
[ea] =>
[nea] =>
[rpp] =>
[ct] =>
[chrono_verification] => KEgPN
[input_submit_12] => Submit
[b857162d0923383b1f95813f2b0d7cdd] => 1
[language] => en-GB
[option] => com_chronoforms
[view] => form
[Itemid] => 278
[lang] => en
[chronoform] => New_Member_Reg
[event] => submit
[password2] => password
[_PLUGINS_] => Array
(
[joomla_registration] => Array
(
[*isRoot] =>
[id] => 81
[name] => Dr Spock
[username] => drspock
[email] => drspock@finbvccc.com
[password] => 2c7427e30422fb0d82a9dc9f75384cce:7B5mfPJ9dRJhDqwHVdaQKOWERw2OqdFJ
[password_clear] => password
[usertype] => deprecated
[block] => 1
[sendEmail] => 0
[registerDate] => 2012-02-09 06:10:44
[lastvisitDate] =>
[activation] => 1340b3f77bbb14d627aee378dad31244
[groups] => Array
(
[0] => 2
)

[*_params] => JRegistry Object
(
[data:protected] => stdClass Object
(
)

)

[*_authGroups] => Array
(
[0] => 10
)

[*_authLevels] => Array
(
[0] => 1
[1] => 4
)

[*_authActions] =>
[*_errorMsg] =>
[*_errors] => Array
(
)

[aid] => 0
[password_confirm] => password
[phone_number] => 555-5555
[company] => Sony
[industry] => Technology
[gender] => Male
[age] => 44
[how_find_us] => Web Search
[introduced] => Other
[input_checkbox_group_32] => Fashion,Themed,Commodities
[other_interests] => Networking
[additional_comments] => none
[ea] =>
[nea] =>
[rpp] =>
[ct] =>
[chrono_verification] => KEgPN
[input_submit_12] => Submit
[b857162d0923383b1f95813f2b0d7cdd] => 1
[language] => en-GB
[option] => com_chronoforms
[view] => form
[Itemid] => 278
[lang] => en
[chronoform] => New_Member_Reg
[event] => submit
[password2] => password
)

)

[chronoform_data] => Array
(
[cf_id] => 16
)

[chronoform_data_cf_id] => 16
[curl_gh] =>
)
NEW MEMBER
Thank you for becoming a member. Please check your email to confirm registration.
After, you will be able to access all areas of InStyleTokyo.com. Enjoy!

Debug Data
Core Captcha
Passed the core captcha check!
Tablechronoforms_data_New_Member_Regis: :bind failed. Invalid source argument.
cURL [GH]
cURL OK : the cURL function was found on this server.
cURL Target URL: http://gator1806.hostgator.com/~instylet/index.php
cURL Values:
cURL:Resource id #155
cURL info: Array ( [url] => http://gator1806.hostgator.com/~instylet/index.php [content_type] => text/html; charset=utf-8 [http_code] => 303 [header_size] => 295 [request_size] => 150 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.158288 [namelookup_time] => 0.000155 [connect_time] => 0.000355 [pretransfer_time] => 0.000361 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => 0 [upload_content_length] => 0 [starttransfer_time] => 0.158229 [redirect_time] => 0 )
Response:
GreyHead
Hi login418,

Err, yes it does; you need to set the values in the subscription array or the hidden lists entry. Either will work.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
login418
set the values in the subscription array or the hidden lists

Not sure what those are. Below is what I have so far and is not working.

cURL Params/Fields Map:
subscription={subscription}
user[name]={name}
user[email]={email}
ctrl=sub
task=optin
option=com_acymailing
hiddenlists=2

Form Target URL:
http://mydomain.com/index.php?

Form Array options:
Fashion=Fashion Event
Themed=Themed Event
Music=Music Event
Movie=Movie Event      
Golf=Golf Event
Charity=Charity Event
Commodities=Commodities
Other=Other
GreyHead
Hi ligin418,

And how do you translate the Form Array options into AcyMailing List IDs and add them to the susbcription array?

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
L
login418
I haven't done that yet. For now I'm just trying to get the form to subscribe to ANY list just to make some progress on this. hiddenlists=2

I don't know how to translate the Form Array options into AcyMailing List IDs and add them to the subscription array. I guess that's the point. I don't know what I'm missing. Acymailing URL method is working though.

FYI:
General list ID 2
Fashion ID 3
Themed ID 4
and so on...

If you would like to log in and have a look I would be in your debt
GreyHead
Hi login418,

First, if you don't have any 'fixed' lists that you want everyone to subscribe to the leave out hiddenlists.

Second, there are two ways to convert your options into lists. The easiest is just to set the option values to the list ids and name the select box 'subscription' :
3=Fashion Event
4=Themed Event
5=Music Event
6=Movie Event
7=Golf Event
8=Charity Event
9=Commodities
1=Other


The more complicated route is to use a Custom code action to map from one to the other - this gives you more flexibility. You can keep the options as
Fashion=Fashion Event
Themed=Themed Event
Music=Music Event
Movie=Movie Event
Golf=Golf Event
Charity=Charity Event
Commodities=Commodities
Other=Other
and then use a Custom Code box like this (I'm assuming that the drop-down name is 'event_interests')
<?php
$list_map = array (
'Fashion' => '2',
'Themed' => '3',
'Music' => '4',
'Movie' => '5',
'Golf' => '9',
'Charity' => '9',
'Commodities' => '3',
'Other' => '9'
);
$subscription = array();
foreach ( $form->data['event_interests'
  • as $d ) {
    $subscription
  • = $list_map[$d];
    }
    // remove duplicate entries
    if ( count($subscription) ) {
    $subscription = array_unique($subscription);
    }
    $form->data['subscription'] = $subscription;
    ?>


    cURL Params/Fields Map:
    subscription={subscription}
    user[name]={name}
    user[email]={email}
    ctrl=sub
    task=optin
    option=com_acymailing


    By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

    Bob
    ChronoForms technical support
    If you'd like to buy me a coffee or two, thank you very much
    GreyHead
    Hi login418,

    I just spent about an hour on this and didn't get it working correctly on your site. I have tidied up the form a bit and corrected a typo in my example - it should be subscription not subscriptions.

    I took a backup copy of your code and tested it on my local site. There I could remove the Joomla! Registration and the DB Save (which appears not to be working) and the AcyMailing registration works OK.

    I suggest that you do the same on your site. Make a copy of the form, strip out the Captcha and Registration parts and debug the AcyMailing part. Once you have that working you can put copy it back to the main form and work on the other parts.

    One problem may be that your AcyMailing requires users to be logged in and I'm not sure if your Registration is doing that.

    Bob
    ChronoForms technical support
    If you'd like to buy me a coffee or two, thank you very much