-
-
Save anstak/3b3a9e29051f9f8f3301c73ae6036a16 to your computer and use it in GitHub Desktop.
пример интеграции wordpress contact form 7 и sendpulse
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 | |
| 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