Skip to content

Commit

Permalink
Save email and phone # to QB for new clients. Fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
timbze committed Nov 29, 2021
1 parent 5771a4a commit 01b6c24
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/quickbooks-online/src/src/Facade/QuickBooksFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public function exportClients(): void
$nameForView = $ucrmClient['companyName'];
}

$email = null;
$emailCheck = $ucrmClient['contacts'][0]['email'];
if (filter_var($emailCheck, FILTER_VALIDATE_EMAIL))
$email = $emailCheck;

$customerData = [
'DisplayName' => sprintf(
'%s (UCRMID-%d)',
Expand All @@ -156,6 +161,12 @@ public function exportClients(): void
'PrintOnCheckName' => $nameForView,
'GivenName' => $ucrmClient['firstName'],
'FamilyName' => $ucrmClient['lastName'],
'PrimaryEmailAddr' => [
'Address' => $email
],
'Mobile' => [
'FreeFormNumber' => $ucrmClient['contacts'][0]['phone']
],
'ShipAddr' => [
'Line1' => $ucrmClient['street1'],
'Line2' => $ucrmClient['street2'],
Expand Down

0 comments on commit 01b6c24

Please sign in to comment.