<commit_before>marketo
=======

A simple Marketo SOAP client.

Usage
-----

**Authentication**

You can authenticate using constants:

	define('MARKETO_SOAP_HOST',      'na-*.marketo.com');
	define('MARKETO_USER_ID',        'User Id');
	define('MARKETO_ENCRYPTION_KEY', 'Encryption Key');

or by setting environment variables:

	$_ENV['MARKETO_SOAP_HOST'];
	$_ENV['MARKETO_USER_ID'];
	$_ENV['MARKETO_ENCRYPTION_KEY'];

**Getting a lead**
	
	require('marketo.php');
	$marketo_client = new Marketo;
	$marketo_client->get_lead_by('email', '<EMAIL>');

This will return the lead object or `FALSE` if not found.

You can get a lead by

 - idnum - The Marketo lead ID
 - cookie - The entire _mkto_trk cookie
 - email - The email address of the lead
 - sdfccontantid - The Salesforce Contact ID
 - sfdcleadid - The Salesforce Lead ID


**Creating/updating a lead**

	require('marketo.php');
	$marketo_client = new Marketo;
	$marketo_client->sync_lead('<EMAIL>', $_COOKIE['_mkto_trk'], array('Unsubscribe' => FALSE));

This will return the updated/created lead object.<commit_msg>Corrected heading level.<commit_after>Marketo
-------

A simple Marketo SOAP client.

Usage
=====

**Authentication**

You can authenticate using constants:

	define('MARKETO_SOAP_HOST',      'na-*.marketo.com');
	define('MARKETO_USER_ID',        'User Id');
	define('MARKETO_ENCRYPTION_KEY', 'Encryption Key');

or by setting environment variables:

	$_ENV['MARKETO_SOAP_HOST'];
	$_ENV['MARKETO_USER_ID'];
	$_ENV['MARKETO_ENCRYPTION_KEY'];

**Getting a lead**
	
	require('marketo.php');
	$marketo_client - new Marketo;
	$marketo_client->get_lead_by('email', '<EMAIL>');

This will return the lead object or `FALSE` if not found.

You can get a lead by

 - idnum - The Marketo lead ID
 - cookie - The entire _mkto_trk cookie
 - email - The email address of the lead
 - sdfccontantid - The Salesforce Contact ID
 - sfdcleadid - The Salesforce Lead ID


**Creating/updating a lead**

	require('marketo.php');
	$marketo_client - new Marketo;
	$marketo_client->sync_lead('<EMAIL>', $_COOKIE['_mkto_trk'], array('Unsubscribe' -> FALSE));

This will return the updated/created lead object.
{'fraction_non_alphanumeric': 0.1359628770301624, 'fraction_numerical': 0.0, 'mean_word_length': 4.629242819843342, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3326303', 'n_tokens_mistral': 760, 'n_tokens_neox': 728, 'n_words': 201}