Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
MP_Addon_Salesforce::prepare_lead_data( array $lead_data )
Prepare lead data to JSON.
Contents
Parameters Parameters
- $lead_data
-
(array) (Required) lead data
Return Return
(false|string) $lead_data { Lead data in JSON. @type string 'firstname' lead first name @type string 'secondname' lead second name @type string 'email' lead email @type string 'phone' lead phone @type string 'zipcode' lead zip code @type string 'yearofbirth' lead year of birth @type string 'investmentamount' investment amount }
Source Source
File: calculator-salesforce-add-on/inc/MP_Addon_Salesforce.php
private function prepare_lead_data( $lead_data ) {
//$investmentamount_value = $this->get_invest_amount( $lead_data['investmentamount'] );
$data = array(
"FirstName" => isset( $lead_data['firstname'] ) ? sanitize_text_field( $lead_data['firstname'] ) : "",
"LastName" => isset( $lead_data['secondname'] ) ? sanitize_text_field( $lead_data['secondname'] ) : "",
"Company" => MortgagePlatform::$plugin_name,
"Phone" => isset( $lead_data['phone'] ) ? sanitize_text_field( $lead_data['phone'] ) : "",
"Email" => isset( $lead_data['email'] ) ? sanitize_text_field( $lead_data['email'] ) : "",
);
/**
* Action salesforce data.
* @since 1.0.0
*
* @param array $data {
* Lead data.
*
* @type string 'FirstName' lead first name
* @type string 'LastName' lead last name
* @type string 'Company' company (Mortgage Platform)
* @type string 'Phone' lead phone
* @type string 'Email' lead email
* }
*/
do_action( 'salesforce_data', $data );
return $data;
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |