Created
April 7, 2017 13:32
-
-
Save gagimilicevic/711ac7e2c2ed5381e110ff468260f002 to your computer and use it in GitHub Desktop.
Integrate CF7 with MailPoet custom function on submit
This file contains 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
function CF7_to_MailPoet_integration(){ | |
$submission = WPCF7_Submission::get_instance(); | |
$posted_data = $submission->get_posted_data(); | |
$email = $posted_data['your-email']; | |
$my_list_id = 3; | |
$user_data = array( | |
'email' => $email, | |
); | |
$data_subscriber = array( | |
'user' => $user_data, | |
'user_list' => array('list_ids' => array($my_list_id)) | |
); | |
$helper_user = WYSIJA::get('user','helper'); | |
$helper_user->addSubscriber($data_subscriber); | |
} | |
add_action('wpcf7_before_send_mail','CF7_to_MailPoet_integration'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment