From 198b557cf3c5709221ffee969dc2796ca0b89fa0 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 3 Sep 2025 10:06:03 +0530 Subject: [PATCH] GWM : email response issue --- app/Controllers/AgentAuthController.php | 2 +- app/Helpers/mail_helper.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Controllers/AgentAuthController.php b/app/Controllers/AgentAuthController.php index 2228f6f..6eedcd1 100644 --- a/app/Controllers/AgentAuthController.php +++ b/app/Controllers/AgentAuthController.php @@ -66,7 +66,7 @@ class AgentAuthController extends ResourceController $mail_content = $otp . ' is your verification code for Nhance.'; $EmailResult = send_login_otp( $email , $subject , $mail_content); - + if ($EmailResult['status'] == 'success') { $result = ['agent_verification' => true, 'message' => "Verified Successfully"]; return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200); diff --git a/app/Helpers/mail_helper.php b/app/Helpers/mail_helper.php index 7be4db9..c4a9c60 100644 --- a/app/Helpers/mail_helper.php +++ b/app/Helpers/mail_helper.php @@ -51,9 +51,7 @@ if (!function_exists('send_login_otp')) { $resp = json_decode($response, true); - - - if ($httpCode === 200) { + if (isset($resp['data'][0]['message']) && $resp['data'][0]['message'] == 'Email request received') { log_message('debug', 'OTP Send Success to agent , email = ' . $to_email); return ['status' => 'success', 'code' => 200, 'message' => 'Send Success']; } else {