From d2f0c6ffb66d8bcccb221195a3c209b9d29ded4b Mon Sep 17 00:00:00 2001 From: sriramv Date: Sat, 24 Jun 2023 15:53:29 +0530 Subject: [PATCH] paymentMail:gwm --- app/Controllers/Sendmail_controller.php | 116 ++++-------------------- 1 file changed, 19 insertions(+), 97 deletions(-) diff --git a/app/Controllers/Sendmail_controller.php b/app/Controllers/Sendmail_controller.php index 74a51eb..8a81f00 100644 --- a/app/Controllers/Sendmail_controller.php +++ b/app/Controllers/Sendmail_controller.php @@ -305,30 +305,12 @@ class Sendmail_controller extends BaseController { - - - // $TransactionData = $this->TransactionModel->where('member_id', session()->get('logged_user'))->orderBy('created_at', 'DESC')->first(); - - // $Transaction_id = $TransactionData['transaction_id']; - - // $timestamp = strtotime($TransactionData['created_at']); - - // $Transaction_date = date('l, F j, Y', $timestamp); - - // $amount = json_decode($TransactionData['transaction'] , true)['payment']['amount_money']['amount']; - - // $payment_method = json_decode($TransactionData['transaction'] , true)['payment']['source_type']; - - + + // $temp_data = $this->MailModel->where('type' , $return)->where('is_active' , 1)->find(); + // if ($temp_data[0]['to']) + // $email->setCC($temp_data[0]['to']); $data['id'] = $return; - - $temp_data = $this->MailModel->where('type' , $return)->where('is_active' , 1)->find(); - - if ($temp_data[0]['to']) - - $email->setCC($temp_data[0]['to']); - $data['TransactionData'] = $this->TransactionModel->where('order_id', $code )->where('member_id', session()->get('logged_user'))->find(); $memberCredits = $this->creditsModel->where('order_id', $code ) ->where('member_id', session()->get('logged_user')) @@ -353,33 +335,13 @@ class Sendmail_controller extends BaseController $data['last_4'] = json_decode($data['TransactionData'][0]['transaction'] , true)['payment']['card_details']['card']['last_4']; $data['html'] = view('success_mail',$data); - // if ($temp_data) { - - // $data['html'] = str_replace("%name%",session()->get('logged_user_name'),$temp_data[0]['html']); - - // $data['html'] = str_replace("%id%",$Transaction_id,$temp_data[0]['html']); - - // $data['html'] = str_replace("%method%",$payment_method,$temp_data[0]['html']); - - // $data['html'] = str_replace("%date%", $Transaction_date,$temp_data[0]['html']); - - // $data['html'] = str_replace("%amount%",$amount,$temp_data[0]['html']); - - - - - + $message = view('verification_mail_temp',$data); - - // } - - if ($temp_data[0]['is_active'] == 1) - - $email->setSubject($temp_data[0]['subject']); - - else - - $email->setSubject('Username Password'); + + // if ($temp_data[0]['is_active'] == 1) + // $email->setSubject($temp_data[0]['subject']); + // else + $email->setSubject('Golf Evolution : Confirmation of your order'); } @@ -423,30 +385,10 @@ class Sendmail_controller extends BaseController { - - - // $TransactionData = $this->TransactionModel->where('member_id', session()->get('logged_user'))->orderBy('created_at', 'DESC')->first(); - - // $Transaction_id = $TransactionData['transaction_id']; - - // $timestamp = strtotime($TransactionData['created_at']); - - // $Transaction_date = date('l, F j, Y', $timestamp); - - // $amount = json_decode($TransactionData['transaction'] , true)['payment']['amount_money']['amount']; - - // $payment_method = json_decode($TransactionData['transaction'] , true)['payment']['source_type']; - - - + // $temp_data = $this->MailModel->where('type' , $return)->where('is_active' , 1)->find(); + // if ($temp_data[0]['to']) + // $email->setCC($temp_data[0]['to']); $data['id'] = $return; - - $temp_data = $this->MailModel->where('type' , $return)->where('is_active' , 1)->find(); - - if ($temp_data[0]['to']) - - $email->setCC($temp_data[0]['to']); - $data['TransactionData'] = $this->TransactionModel->where('order_id', $code )->where('member_id', session()->get('logged_user'))->find(); $data['category'] = json_decode($data['TransactionData'][0]['transaction'] , true)[0]['category']; $data['code'] = json_decode($data['TransactionData'][0]['transaction'] , true)[0]['code']; @@ -456,33 +398,13 @@ class Sendmail_controller extends BaseController $data['formattedDate'] = date('l, F j, Y', $timestamp); $data['html'] = view('failed_mail',$data); - // if ($temp_data) { - - // $data['html'] = str_replace("%name%",session()->get('logged_user_name'),$temp_data[0]['html']); - - // $data['html'] = str_replace("%id%",$Transaction_id,$temp_data[0]['html']); - - // $data['html'] = str_replace("%method%",$payment_method,$temp_data[0]['html']); - - // $data['html'] = str_replace("%date%", $Transaction_date,$temp_data[0]['html']); - - // $data['html'] = str_replace("%amount%",$amount,$temp_data[0]['html']); - - - - - + $message = view('verification_mail_temp',$data); - - // } - - if ($temp_data[0]['is_active'] == 1) - - $email->setSubject($temp_data[0]['subject']); - - else - - $email->setSubject('Username Password'); + + // if ($temp_data[0]['is_active'] == 1) + // $email->setSubject($temp_data[0]['subject']); + // else + $email->setSubject('Golf Evolution : Order Failed. Please try again'); }