Skip navigation

Enable mailing list form on Bucketworks.org to populate Campaign Monitor

Task: Enable mailing list form on Bucketworks.org to populate Campaign Monitor

Assigned To: 
James Carlson
Status: 
Resolved
Priority: 
Normal
Type: 
Task
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.

#1

I'll take a look right away. 

#2

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. 

 

 

<?php
//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 = 'http://bucketworks.createsend.com/t/y/s/nkjny/';
$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);
?>

 

#3

Status: Open » Resolved

I GOT IT TO WORK

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. 

 

<?php
$content['cm-nkjny-nkjny'] = $form['submitted']['newsletter_e_mail']['#value'];
$content['cm-name'] = $form['submitted']['newsletter_name']['#value'];
 
$url = 'http://bucketworks.createsend.com/t/y/s/nkjny/';
$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. 

Bucketworks