From 54d8662bce911f48aef02b72d8a0941d6fd05f0f Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Thu, 28 Aug 2025 17:16:40 +0530 Subject: [PATCH] CHANGE: in lead mail send history data : GWM --- app/Controllers/LeadsController.php | 2 +- app/Helpers/MailHelper.php | 1 + app/Models/GmailSentHistoryModel.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 95d9adad..dfee8dc0 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -2761,7 +2761,7 @@ class LeadsController extends BaseController $string = implode(", ", $cc_mails); $bcc_string = implode(", ", $bcc_mails); - $res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $recipient['email'], 'cc' => $string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string, $common]); + $res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $recipient['email'], 'cc' => $string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string, 'common' => $common]); // !dd($res); $result_data[] = ['mail' => $recipient['email'], 'status' => $res]; } diff --git a/app/Helpers/MailHelper.php b/app/Helpers/MailHelper.php index cce74a9a..89e90262 100755 --- a/app/Helpers/MailHelper.php +++ b/app/Helpers/MailHelper.php @@ -322,6 +322,7 @@ class MailHelper $from_address = isset($params['from_mail']) && !empty($params['from_mail']) ? $params['from_mail'] : getenv('email.fromEmail'); // $from_address = "claims@nhanceindia.in"; + if(isset($params['common'])){ $params['common']['from_mail'] = $from_address; } try { $curl = curl_init(); diff --git a/app/Models/GmailSentHistoryModel.php b/app/Models/GmailSentHistoryModel.php index 9c2fecf0..d26486e8 100644 --- a/app/Models/GmailSentHistoryModel.php +++ b/app/Models/GmailSentHistoryModel.php @@ -7,5 +7,5 @@ use CodeIgniter\Model; class GmailSentHistoryModel extends Model{ protected $table = 'gmail_sent_history'; protected $primaryKey = 'id'; - protected $allowedFields = ["id", "mail", "bcc", "cc", "message", "attachments", "client_id", "client_branch_id", "client_policy_id", "employee_policy_id", "employee_id", "mail_type", "gmail_api_status", "gmail_api_id", "common", "created_by", "created_at", "updated_by", "updated_at", "isactive","received_message"]; + protected $allowedFields = ["id", "mail", "bcc", "cc", "message", "attachments", "client_id", "client_branch_id", "client_policy_id", "employee_policy_id", "employee_id", "mail_type", "gmail_api_status", "gmail_api_id", "module", "pk", "from_mail", "created_by", "created_at", "updated_by", "updated_at", "isactive","received_message"]; } \ No newline at end of file