Last active
November 19, 2015 22:26
-
-
Save lancegliser/980cc34b3289891e6cc2 to your computer and use it in GitHub Desktop.
Using the emfluence marketing platform php api library
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 | |
$api = new Emfl_Platform_API($api_key); | |
$data = array(); | |
$data['groupIDs'] = !empty($_POST['groups'])? $_POST['groups'] : ''; | |
$data['originalSource'] = trim( $_POST['source'] ); | |
$data['firstName'] = !empty( $_POST['first_name'] )? trim( $_POST['first_name'] ) : ''; | |
$data['lastName'] = !empty( $_POST['last_name'] )? trim( $_POST['last_name'] ) : ''; | |
$data['title'] = !empty( $_POST['title'] )? trim( $_POST['title'] ) : ''; | |
$data['company'] = !empty( $_POST['company'] )? trim( $_POST['company'] ) : ''; | |
// $data['phone'] = trim( $form_data['phone_number'] ); | |
$data['email'] = trim( $_POST['email'] ); | |
$data['customFields'] = array(); | |
$data['customFields']['custom1'] = !empty( $_POST['custom_1'] )? array('value' => trim( $_POST['custom_1'] ) ) : ''; | |
$result = $api->contacts_save($data); | |
if( !$result->success ){ | |
$success = FALSE; | |
$messages[] = array('type' => 'error', 'value' => __('An error occurred contacting the email service.')); | |
} else { | |
$success = TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment