I have a custom form in my site that has name and email address field. How can I get the value of this 2 fields to be added on campaign monitor subscriber list when the user successfully submits the form?

This is my form action:

define('WP_USE_THEMES', false);

$articletitle = $_POST['articletitle'];
$articlename = $_POST['articlename'];
$articleemail = $_POST['articleemail'];
$articletext = $_POST['articletext'];

$org_post = array(
  'post_title'    => $articletitle,
  'post_content'  => $articletext,
  'post_status'   => 'pending',
  'post_type'     => 'post',
  'post_author'   => 6
$new_id = wp_insert_post( $org_post );

update_post_meta($new_id, 'contact_name', $articlename);
update_post_meta($new_id, 'contact_email', $articleemail);

header("Location: /success/");

You will have to use the Campaign Monitor Api:


Or if you only use it for newsletter sign up, you can use a plugin: https://wordpress.org/plugins/search.php?q=campaign+monitor

| improve this answer | |
  • Remove the quotes: $result = $cm->subscriberAdd($eventemail, $name); – BlueCloudNL Apr 24 '15 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy