Skip navigation

Enable mailing list form on to populate Campaign Monitor

Task: Enable mailing list form on to populate Campaign Monitor

Assigned To: 
James Carlson
Due Date: 
Tuesday, Apr 17

Sasha, if you can help with this please do so. The form currently just collects info as a 'webform' and then we have to manually import it into Campaign Monitor. I know there is a more automatic way to do this to eliminate the manual step. Research the options on Campaign Monitor's website and find out how.

Comment viewing options
Select your preferred way to display the comments and click "Save settings" to activate your changes.


I'll take a look right away. 


I tried the first approach from here.

with this as my result:

It seems to be a dud, but I'm not sure why. The link I posted above has a second approach that I'm going to try but I'm copying my results below for posterity in case I decide to pursue this course later. 



//get the email address and any additional fields
$content['cm-nkjny-nkjny'] = $form['submitted']['E-Mail']['#value'];
$content['cm-name'] = $form['submitted']['Name']['#value'];
//send data to the form
$url = '';
$headers = array('Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8');
$data = http_build_query($content, '', '&');
$req = drupal_http_request($url, $headers, 'POST', $data);



Status: Open » Resolved


It turns out that the field names needed are actually the field keys - A menu item found by clicking "form components" then "edit" for each field  in the webform, then advanced settings.

here is what I've placed in the additional processing box in order to make this work, with emphasis added on the bits corrected from my last post. 


$content['cm-nkjny-nkjny'] = $form['submitted']['newsletter_e_mail']['#value'];
$content['cm-name'] = $form['submitted']['newsletter_name']['#value'];
$url = '';
$headers = array('Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8');
$data = http_build_query($content, '', '&');
$req = drupal_http_request($url, $headers, 'POST', $data);

As long as there are no complaints, I'll be victoriously resolving this case.