Last active
March 14, 2017 10:38
-
-
Save rothschild86/4c2a9e82eecc0626cfad7318a045b325 to your computer and use it in GitHub Desktop.
Caldera Forms to MailPoet integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
} |
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
See here for custom field integration http://stackoverflow.com/questions/35867713/mailpoet-custom-forms-and-custom-fields