From ce6a1a6a5eba60fa12983b5c66cce828afafb788 Mon Sep 17 00:00:00 2001 From: Steve Avery Date: Mon, 30 Nov 2015 22:14:04 -0800 Subject: [PATCH] Add the how-did-you-hear field to alert email --- AsyncSalesforce.php | 8 +- UCSalesforce.php | 13 +- config/enterprise.wsdl.xml | 971 +++++++++++++++++++++++++++++++++---- 3 files changed, 888 insertions(+), 104 deletions(-) diff --git a/AsyncSalesforce.php b/AsyncSalesforce.php index 96a74fb..a4f5fa2 100644 --- a/AsyncSalesforce.php +++ b/AsyncSalesforce.php @@ -276,11 +276,15 @@ private function update_or_create_donation(&$info) { // update donation with amount and success. $this->update_donation($info, $dli); - // we need this for the email: + // we need these for the email: if(strlen($dli['In_Honor_Of__c']) > 0) { $info['honor'] = sprintf("In Honor of: %s\n", $dli['In_Honor_Of__c']); } + + if(strlen($dli['Referred_by__c']) > 0) { + $info['referral'] = $dli['Referred_by__c']; + } } else { @@ -420,7 +424,9 @@ private function send_email(&$info) { Amount: {$info['amount-string']} Recurrence: {$info['recurrence-string']} Email: {$this->contact->Email} +Phone: {$this->contact->Phone} Location: {$this->contact->MailingCity}, {$this->contact->MailingState} +Referred by: {$info['referral']} {$info['honor']} Salesforce Link: https://na32.salesforce.com/{$this->contact->Id} EOF; diff --git a/UCSalesforce.php b/UCSalesforce.php index 467cc37..6fda7f1 100644 --- a/UCSalesforce.php +++ b/UCSalesforce.php @@ -123,9 +123,10 @@ private function merge_contact(&$info) { // Referral field if(!empty($info['hearabout'])) { - if(!isset($this->contact->How_did_you_hear_about_Spark__c)) { - $this->contact->How_did_you_hear_about_Spark__c = - ucfirst($info['hearabout']); + $info['referral'] = ucfirst($info['hearabout']); + + if(!isset($this->contact->How_did_you_hear_about_Spark__c)) { + $this->contact->How_did_you_hear_about_Spark__c = $info['referral']; } // Set referral if it's potentially a contact. @@ -138,6 +139,11 @@ private function merge_contact(&$info) { $this->contact->Referred_By__c = $id; } } + + // Get the extra data if it's there + if(!empty($info['hearabout-extra'])) { + $info['referral'] .= ': ' . $info['hearabout-extra']; + } } } @@ -181,6 +187,7 @@ private function create_pending_li(&$info) { $donation->Type__c = 'Membership'; $donation->Stripe_Status__c = 'Pending'; $donation->Stripe_Id__c = $info['stripe-id']; + $donation->Referred_by__c = parent::string_truncate($info['referral']); $donation->In_Honor_Of__c = parent::string_truncate($info['inhonorof'], 64); diff --git a/config/enterprise.wsdl.xml b/config/enterprise.wsdl.xml index f8d18be..ff491af 100644 --- a/config/enterprise.wsdl.xml +++ b/config/enterprise.wsdl.xml @@ -1,11 +1,11 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -84,6 +84,7 @@ All Rights Reserved + @@ -141,6 +142,7 @@ All Rights Reserved + @@ -205,6 +207,7 @@ All Rights Reserved + @@ -367,6 +370,7 @@ All Rights Reserved + @@ -498,6 +502,26 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + @@ -637,9 +661,11 @@ All Rights Reserved + + @@ -660,6 +686,7 @@ All Rights Reserved + @@ -763,6 +790,7 @@ All Rights Reserved + @@ -869,6 +897,7 @@ All Rights Reserved + @@ -877,6 +906,7 @@ All Rights Reserved + @@ -1038,6 +1068,7 @@ All Rights Reserved + @@ -1246,6 +1277,7 @@ All Rights Reserved + @@ -1544,6 +1576,7 @@ All Rights Reserved + @@ -1880,6 +1913,7 @@ All Rights Reserved + @@ -1929,6 +1963,7 @@ All Rights Reserved + @@ -1993,6 +2028,7 @@ All Rights Reserved + @@ -2002,6 +2038,7 @@ All Rights Reserved + @@ -2129,6 +2166,7 @@ All Rights Reserved + @@ -2197,6 +2235,7 @@ All Rights Reserved + @@ -2297,6 +2336,7 @@ All Rights Reserved + @@ -2324,6 +2364,7 @@ All Rights Reserved + @@ -2394,6 +2435,30 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + @@ -2457,8 +2522,10 @@ All Rights Reserved + + @@ -2501,6 +2568,7 @@ All Rights Reserved + @@ -2548,6 +2616,7 @@ All Rights Reserved + @@ -2610,6 +2679,7 @@ All Rights Reserved + @@ -2823,6 +2893,7 @@ All Rights Reserved + @@ -2883,6 +2954,7 @@ All Rights Reserved + @@ -2917,6 +2989,7 @@ All Rights Reserved + @@ -2953,13 +3026,11 @@ All Rights Reserved + + + - - - - - @@ -3269,6 +3340,7 @@ All Rights Reserved + @@ -3343,6 +3415,7 @@ All Rights Reserved + @@ -3463,6 +3536,7 @@ All Rights Reserved + @@ -3473,6 +3547,7 @@ All Rights Reserved + @@ -3491,6 +3566,7 @@ All Rights Reserved + @@ -3512,14 +3588,27 @@ All Rights Reserved - + - + + + + + + + + + + + + + + @@ -3528,10 +3617,11 @@ All Rights Reserved + - + @@ -3541,35 +3631,64 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3614,6 +3733,7 @@ All Rights Reserved + @@ -3681,6 +3801,7 @@ All Rights Reserved + @@ -3837,6 +3958,7 @@ All Rights Reserved + @@ -3931,6 +4053,7 @@ All Rights Reserved + @@ -4011,6 +4134,7 @@ All Rights Reserved + @@ -4053,6 +4177,7 @@ All Rights Reserved + @@ -4075,11 +4200,13 @@ All Rights Reserved + - + + @@ -4133,12 +4260,15 @@ All Rights Reserved + + + @@ -4147,6 +4277,25 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + @@ -4164,6 +4313,33 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4627,6 +4803,7 @@ All Rights Reserved + @@ -4727,6 +4904,7 @@ All Rights Reserved + @@ -4926,6 +5104,7 @@ All Rights Reserved + @@ -4962,6 +5141,7 @@ All Rights Reserved + @@ -5019,6 +5199,10 @@ All Rights Reserved + + + + @@ -5199,6 +5383,9 @@ All Rights Reserved + + + @@ -5339,6 +5526,7 @@ All Rights Reserved + @@ -5403,7 +5591,9 @@ All Rights Reserved + + @@ -5522,6 +5712,7 @@ All Rights Reserved + @@ -5739,6 +5930,7 @@ All Rights Reserved + @@ -5781,6 +5973,7 @@ All Rights Reserved + @@ -5950,6 +6143,7 @@ All Rights Reserved + @@ -5978,6 +6172,7 @@ All Rights Reserved + @@ -5997,6 +6192,7 @@ All Rights Reserved + @@ -6110,6 +6306,7 @@ All Rights Reserved + @@ -6138,6 +6335,7 @@ All Rights Reserved + @@ -6157,6 +6355,7 @@ All Rights Reserved + @@ -6206,13 +6405,30 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + - @@ -6231,6 +6447,7 @@ All Rights Reserved + @@ -6239,6 +6456,52 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6387,6 +6650,8 @@ All Rights Reserved + + @@ -6513,6 +6778,8 @@ All Rights Reserved + + @@ -6550,6 +6817,7 @@ All Rights Reserved + @@ -6651,6 +6919,7 @@ All Rights Reserved + @@ -6679,6 +6948,7 @@ All Rights Reserved + @@ -6698,6 +6968,7 @@ All Rights Reserved + @@ -6733,6 +7004,8 @@ All Rights Reserved + + @@ -6845,6 +7118,7 @@ All Rights Reserved + @@ -6867,6 +7141,7 @@ All Rights Reserved + @@ -6886,6 +7161,7 @@ All Rights Reserved + @@ -6896,6 +7172,7 @@ All Rights Reserved + @@ -6924,6 +7201,7 @@ All Rights Reserved + @@ -7022,6 +7300,46 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7050,16 +7368,17 @@ All Rights Reserved - + - - - - - - + + + + + + + @@ -7108,7 +7427,7 @@ All Rights Reserved - + @@ -7147,6 +7466,7 @@ All Rights Reserved + @@ -7247,6 +7567,7 @@ All Rights Reserved + @@ -7450,6 +7771,7 @@ All Rights Reserved + @@ -7481,6 +7803,7 @@ All Rights Reserved + @@ -7659,6 +7982,7 @@ All Rights Reserved + @@ -7745,6 +8069,8 @@ All Rights Reserved + + @@ -7791,6 +8117,7 @@ All Rights Reserved + @@ -7802,6 +8129,7 @@ All Rights Reserved + @@ -7824,7 +8152,8 @@ All Rights Reserved - + + @@ -7860,6 +8189,72 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7867,11 +8262,15 @@ All Rights Reserved + + + + @@ -7899,6 +8298,7 @@ All Rights Reserved + @@ -7913,6 +8313,25 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + @@ -8347,12 +8766,12 @@ All Rights Reserved - - - - - - + + + + + + @@ -8363,6 +8782,7 @@ All Rights Reserved + @@ -8370,7 +8790,7 @@ All Rights Reserved - + @@ -8378,7 +8798,7 @@ All Rights Reserved - + @@ -8429,6 +8849,43 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -8595,7 +9052,14 @@ All Rights Reserved + + + + + + + @@ -8612,9 +9076,12 @@ All Rights Reserved + + + @@ -8622,6 +9089,7 @@ All Rights Reserved + @@ -8652,6 +9120,7 @@ All Rights Reserved + @@ -8670,6 +9139,7 @@ All Rights Reserved + @@ -8698,6 +9168,7 @@ All Rights Reserved + @@ -8725,6 +9196,7 @@ All Rights Reserved + @@ -8756,6 +9228,9 @@ All Rights Reserved + + + @@ -8816,6 +9291,15 @@ All Rights Reserved + + + + + + + + + @@ -8907,9 +9391,10 @@ All Rights Reserved - - - + + + + @@ -8917,6 +9402,7 @@ All Rights Reserved + @@ -8930,11 +9416,13 @@ All Rights Reserved + + @@ -9037,11 +9525,13 @@ All Rights Reserved + + @@ -9050,6 +9540,7 @@ All Rights Reserved + @@ -9069,6 +9560,7 @@ All Rights Reserved + @@ -9115,6 +9607,16 @@ All Rights Reserved + + + + + + + + + + @@ -9158,12 +9660,25 @@ All Rights Reserved - - + + + + + + + + + + + + + + + @@ -9486,10 +10001,27 @@ All Rights Reserved - + + + + + + + + + + + + + + + + + + @@ -9603,6 +10135,46 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9684,6 +10256,7 @@ All Rights Reserved + @@ -9707,8 +10280,9 @@ All Rights Reserved + - + @@ -9863,6 +10437,42 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9895,6 +10505,7 @@ All Rights Reserved + @@ -9924,6 +10535,9 @@ All Rights Reserved + + + @@ -9934,6 +10548,9 @@ All Rights Reserved + + + @@ -9964,7 +10581,7 @@ All Rights Reserved - + @@ -10013,9 +10630,18 @@ All Rights Reserved + + + + + + + + + - + @@ -10039,29 +10665,30 @@ All Rights Reserved - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -10285,6 +10912,7 @@ All Rights Reserved + @@ -10491,7 +11119,8 @@ All Rights Reserved - + + @@ -10518,6 +11147,8 @@ All Rights Reserved + + @@ -10582,6 +11213,24 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + @@ -10782,6 +11431,47 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11394,16 +12084,34 @@ All Rights Reserved + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + @@ -11416,6 +12124,7 @@ All Rights Reserved + @@ -11430,6 +12139,8 @@ All Rights Reserved + + @@ -11465,6 +12176,7 @@ All Rights Reserved + @@ -11504,6 +12216,7 @@ All Rights Reserved + @@ -11566,6 +12279,7 @@ All Rights Reserved + @@ -11580,6 +12294,8 @@ All Rights Reserved + + @@ -11615,6 +12331,7 @@ All Rights Reserved + @@ -11654,6 +12371,7 @@ All Rights Reserved + @@ -11737,63 +12455,63 @@ All Rights Reserved - + - + - + - + - + - + - + - + - + @@ -11987,6 +12705,13 @@ All Rights Reserved + + + + + + + @@ -12204,6 +12929,13 @@ All Rights Reserved + + + + + + + @@ -12261,7 +12993,7 @@ All Rights Reserved - Describe a number sObjects + Describe multiple sObjects (upto 100) @@ -12363,6 +13095,12 @@ All Rights Reserved + + Describe the Path Assistants for the given sObject and optionally RecordTypes + + + + Describe the approval layouts of the given sObject @@ -12617,6 +13355,13 @@ All Rights Reserved + + Perform a template merge on one or more blocks of text. Optionally, just validate the template text. + + + + + Perform a series of predefined actions such as quick create or log a task @@ -12919,6 +13664,18 @@ All Rights Reserved + + + + + + + + + + + + @@ -13566,6 +14323,20 @@ All Rights Reserved + + + + + + + + + + + + + + @@ -13648,7 +14419,7 @@ All Rights Reserved Sforce SOAP API - +