One List, Two Different Thanksgiving Pages with Mailchimp

Mailchimp associates each form with one list.

I would like to have a registration form on page1.html that sends users to Page1ty.html and another form on the page. html, which sends users to the Page2ty.html page. But both forms must submit users to the same list. As indicated above, this is not possible using their basic forms. I will need two lists.

Mailchimp says that such routing may be possible using their API. Does anyone know how to go about doing the above types of subscribers?

+4
source share
1 answer

You simply create custom forms and bind to the MailChimp API, but by the last update you will need to make sure that you have administrator rights.

You include (require) the MCAPI.class.php and config.inc.php files from their API loading , and then write your process (I use PHP ).

Once you have downloaded the files and configured your config.inc.php file with the appropriate credentials (API key and list ID), you are ready to go.

Here's a sample in PHP that subscribes the user to a list, but you will need to read the API docs to get the exact functionality you are looking for.

 <?php session_start(); // --- Sample fields - depends on your list $mailChimpTIME = date('Ymd H:i:s'); $mailChimpFirstName = // First Name $mailChimpLastName = // Last Name $mailChimpEmailAddress = // Email Address require_once 'MCAPI.class.php'; require_once 'config.inc.php'; //contains apikey $api = new MCAPI($apikey); $merge_vars = array( 'FNAME'=>$mailChimpFirstName, 'LNAME'=>$mailChimpLastName, 'EMAIL'=>$mailChimpEmailAddress, 'OPTIN_IP'=>$_SERVER['REMOTE_ADDR'], 'OPTIN_TIME'=>$mailChimpTIME ); $email_type = 'html'; $double_optin = true; $update_existing = true; $replace_interests = false; // By default this sends a confirmation email - you will not see new members // until the link contained in it is clicked! $retval = $api->listSubscribe( $listId, $mailChimpEmailAddress, $merge_vars, $email_type, $double_optin, $update_existing, $replace_interests); if ($api->errorCode){ echo "Unable to load listSubscribe()!\n"; echo "\tCode=".$api->errorCode."\n"; echo "\tMsg=".$api->errorMessage."\n"; } else { // Success //echo "Subscribed - look for the confirmation email!\n"; } ?> 
+6
source

All Articles