Skip to content

Instantly share code, notes, and snippets.

@paulyabsley
paulyabsley / cm-signup.php
Created Apr 24, 2019
Campaign Monitor API add list subscriber via custom form in wordpress theme
View cm-signup.php
<?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.';