Skip to content

Instantly share code, notes, and snippets.

@smartdeal
Last active March 1, 2022 07:11
Show Gist options
  • Select an option

  • Save smartdeal/c23a7e88ac2dc9ce22875ea5fe98c2e8 to your computer and use it in GitHub Desktop.

Select an option

Save smartdeal/c23a7e88ac2dc9ce22875ea5fe98c2e8 to your computer and use it in GitHub Desktop.
пример интеграции #Wordpress #Sendpulse #WP_CF7
<?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) );
}
}
?>
@farik92

farik92 commented Feb 15, 2022

Copy link
Copy Markdown

@snmazko действительно рабочий вариант!!!
Спасибо за подробную инструкцию.

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