Skip to content

Instantly share code, notes, and snippets.

@rothschild86
Last active March 14, 2017 10:38
Show Gist options
  • Save rothschild86/4c2a9e82eecc0626cfad7318a045b325 to your computer and use it in GitHub Desktop.
Save rothschild86/4c2a9e82eecc0626cfad7318a045b325 to your computer and use it in GitHub Desktop.
Caldera Forms to MailPoet integration
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//required plugins: code snippets, caldera forms, caldera forms run action, MailPoet
add_action('consult_req_submitted', 'consult_req_submitted_sync');
function consult_req_submitted_sync( $data ){
$caldera_name = $data[ 'your_name' ]; //this is the caldera field slug
$caldera_email = $data[ 'email' ]; //this is the caldera field slug
$user_data = array(
'firstname' => $caldera_name,
'email' => $caldera_email
); //also can fill in 'lastname'
$data_subscriber = array(
'user' => $user_data,
'user_list' => array('list_ids' => array(6)) //hard coded MailPoet list id
);
$helper_user = WYSIJA::get('user','helper');
$helper_user->addSubscriber($data_subscriber);
//this function will add the subscriber to mailpoet
}
@rothschild86
Copy link
Author

@micker
Copy link

micker commented Mar 14, 2017

hello did finish this plugin that can be use for caldera ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment