Skip to content

Instantly share code, notes, and snippets.

View paulyabsley's full-sized avatar

Paul Yabsley paulyabsley

View GitHub Profile
paulyabsley / cm-signup.php
Created April 24, 2019 13:02
Campaign Monitor API add list subscriber via custom form in wordpress theme
View cm-signup.php
add_action('tb_ajax_newsletter_signup', 'ajax_newsletter_signup');
add_action('tb_nopriv_ajax_newsletter_signup', 'ajax_newsletter_signup');
function ajax_newsletter_signup() {
require_once '../libs/campaignmonitor/csrest_subscribers.php';
$message_success = 'Thanks for signing up';
$message_error_general = 'There was a problem with the newsletter signup submission. Please try again.';