Created
May 22, 2017 16:30
-
-
Save growdev/4740efd3c45b547a2ebb0bd48a0586a6 to your computer and use it in GitHub Desktop.
Setup CK API and Subscribe customer to Form
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
<?php | |
$options = get_option( '_wp_convertkit_settings' ); | |
$api_key = $options && array_key_exists( 'api_key', $options) ? $options['api_key'] : null; | |
$api_secret = $options && array_key_exists( 'api_secret', $ptions) ? $options['api_secret'] : null; | |
$debug = $options && array_key_exists( 'debug', $options) ? $options['debug'] : null; | |
$api = new ConvertKitAPI( $api_key,$api_secret,$debug ); | |
$form_id = '11111'; | |
$name = 'Test Test'; | |
$email = 'test@test.com'; | |
$api->form_subscribe( $form_id, array( 'email' => $email, 'name' => $name ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment