Skip to content

Commit

Permalink
hotfix- social
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioken committed Aug 16, 2024
1 parent d47115d commit 26758c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/Domains/Connectors/Zoho/Actions/SyncZohoLeadAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Kanvas\Guild\Leads\Models\Lead;
use Kanvas\Guild\Leads\Models\LeadReceiver;
use Kanvas\Guild\Leads\Models\LeadStatus;
use Kanvas\Guild\Organizations\Actions\CreateOrganizationAction;
use Kanvas\Guild\Organizations\DataTransferObject\Organization;
use Kanvas\Guild\Pipelines\Models\Pipeline;
use Kanvas\Users\Models\UsersAssociatedApps;
use Spatie\LaravelData\DataCollection;
Expand Down Expand Up @@ -136,6 +138,18 @@ public function execute(?Record $zohoLead = null): ?Lead
$localLead->users_id = $user->getId();
} */

if (! empty($zohoLead->Company)) {
$organization = (new CreateOrganizationAction(
new Organization(
name: $zohoLead->Company,
company: $this->company,
app: $this->app,
user: $user ?? $this->company->user
)
))->execute();
$localLead->organization_id = $organization->getId();
}

$localLead->people->firstname = $zohoLead->First_Name;
$localLead->people->lastname = $zohoLead->Last_Name;
$localLead->firstname = $zohoLead->First_Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ public function execute(Model $entity, AppInterface $app, array $params): array
}
$messages = [];
foreach ($params['customsFields'] as $customField) {
$messageContent = $entity->get($customField);
if (empty($messageContent)) {

This comment has been minimized.

Copy link
@FredPeal

FredPeal Aug 19, 2024

Contributor

To do for Jess
Why we have custom fields empty ?

continue;
}
$data = MessageInput::from(
[
'app' => $app,
'company' => $entity->company,
'user' => $entity->user,
'type' => $messageType,
'message' => $entity->get($customField),
'message' => $messageContent,
]
);
$message[] = (new CreateMessageAction($data))->execute();
Expand Down

0 comments on commit 26758c9

Please sign in to comment.