Skip to content

Instantly share code, notes, and snippets.

@anstak
Forked from smartdeal/cf7-sendpulse.php
Created March 3, 2017 14:53
Show Gist options
  • Select an option

  • Save anstak/3b3a9e29051f9f8f3301c73ae6036a16 to your computer and use it in GitHub Desktop.

Select an option

Save anstak/3b3a9e29051f9f8f3301c73ae6036a16 to your computer and use it in GitHub Desktop.
пример интеграции wordpress contact form 7 и sendpulse
<?php
function add_email_to_sendpulse($contact_form) {
$wpcf7 = WPCF7_ContactForm::get_current();
$submission = WPCF7_Submission::get_instance();
$data = $submission->get_posted_data();
$cur_email = $data['Email'];
if ($cur_email != '') {
define( 'API_USER_ID', '' );
define( 'API_SECRET', '' );
define( 'TOKEN_STORAGE', 'file' );
$SPApiProxy = new SendpulseApi( API_USER_ID, API_SECRET, TOKEN_STORAGE );
$SPApiProxy->addEmails(633919, array($cur_email) );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment