Frage

first I must say I'm a noob at MailChimp all round. I have looked at their documentation and wasn't able to understand enough to get my answer from that. I know, I'm a noob, but I'm also a noob that has done enough research to only be asking this as a last resort. So, this is what I'm trying to do:

On my sign up form, I have a select field with a list of cities. I would like to have MailChimp capture this information. From my understanding, this would be done with the merge_var, Address. However, this is as far as I know.

Could I perhaps get an example of what the code would look like for what I'm trying to do?

Thanks

War es hilfreich?

Lösung

The question here is if you want to use an Address field or a Text field to accomplish this, as these are different types of merge_vars as far as the MailChimp system goes. I'd recommend experimenting with the MailChimp web app with the different data types to find out what's best for you.

Saying that, once you've got your data type decided, depending on what you chose the listSubscibe method would be used to pass the data with the appropriate syntax for your data type. Here's the documentation that walks through the syntax you'd need to use for each date type:

http://apidocs.mailchimp.com/api/1.3/listsubscribe.func.php

The text field will be pretty straight forward. Whereas the address is going to be an array like:

'address1'=>array('addr1'=>'12335 Hope St', 'city'=>'Dallas', 'state'=>'TX', 'zip'=>'76058')

Use the json example at the bottom of that page which has an example of this address array setup. Though, if you're literally just collecting a city, I'd recommend just using a text field or a drop down field.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top