From bd3151add9c2b4d743af3e44291778b5832616cc Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 27 Feb 2026 16:08:01 +0530 Subject: [PATCH] calander activity push --- app/Controllers/SalesController.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/Controllers/SalesController.php b/app/Controllers/SalesController.php index 44ea7aae..4e139caa 100644 --- a/app/Controllers/SalesController.php +++ b/app/Controllers/SalesController.php @@ -1238,9 +1238,23 @@ class SalesController extends BaseController /* ---------------- SUMMARY ---------------- */ - $summary = ucfirst($input['activity_type']) . - ' with ' . - $lead_data['company_name']; + $activityType = ucfirst($input['activity_type']); + + $prepositionMap = [ + 'Email' => 'to', + 'Call' => 'with', + 'Meeting' => 'with', + 'Visit' => 'to', + 'Demo' => 'with', + 'Share Docs' => 'to', + 'To Do' => 'for' + ]; + + $preposition = $prepositionMap[$activityType] ?? 'with'; + + $summary = "Activity scheduled : {$activityType} {$preposition} {$lead_data['company_name']}"; + + /* ---------------- GOOGLE PAYLOAD ---------------- */