CHANGE_purchase_module:ss
This commit is contained in:
parent
3172f5602a
commit
fd6bc837d0
BIN
PO00000003-2024-04-23-12-04-15.pdf
Normal file
BIN
PO00000003-2024-04-23-12-04-15.pdf
Normal file
Binary file not shown.
BIN
PO00000004-2024-04-23-12-04-45.pdf
Normal file
BIN
PO00000004-2024-04-23-12-04-45.pdf
Normal file
Binary file not shown.
BIN
PO00000005-2024-04-23-12-06-31.pdf
Normal file
BIN
PO00000005-2024-04-23-12-06-31.pdf
Normal file
Binary file not shown.
@ -301,7 +301,9 @@ class Purchase extends BaseController
|
||||
// send purhase data through mail
|
||||
$VendorModel = new VendorModel();
|
||||
$vendor = $VendorModel->where('vendor_id',$this->request->getPost('vendor_id'))->findAll();
|
||||
$this->download_purchase_invoice($purchase_order_id, $vendor[0]['vendor_email']);
|
||||
$mail_status = $this->download_purchase_invoice($purchase_order_id, $vendor[0]['vendor_email']);
|
||||
echo $mail_status;die;
|
||||
$_SESSION['mail_status'] = $mail_status;
|
||||
}
|
||||
|
||||
|
||||
@ -453,8 +455,9 @@ public function download_purchase_invoice($purchase_order_id, $mail = null)
|
||||
$mail_response = MailHelper::send_email($data);
|
||||
if(json_decode($mail_response)->code == 200)
|
||||
{
|
||||
unlink($pdfFilePath);
|
||||
unlink($pdfFilePath);
|
||||
}
|
||||
return json_decode($mail_response)->code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ class MailHelper
|
||||
{
|
||||
try {
|
||||
|
||||
$email = $params['mail'];
|
||||
$mail = $params['mail'];
|
||||
$subject = $params['subject'];
|
||||
$message = $params['message'];
|
||||
|
||||
@ -24,7 +24,7 @@ class MailHelper
|
||||
$email->setMailType('html');
|
||||
$email->setFrom('bbone@venbait.in', 'The Mechnaic');
|
||||
|
||||
$email->setTo($email);
|
||||
$email->setTo($mail);
|
||||
|
||||
$email->setSubject($subject);
|
||||
$email->setMessage($message);
|
||||
@ -32,13 +32,13 @@ class MailHelper
|
||||
if(isset($params['attachment'])) { $email->attach($params['attachment']); }
|
||||
|
||||
if ($email->send()) {
|
||||
return json_encode(['status' => 'success','code' => 200, 'message'=>'Email Sent Successfully...','data' => $email,],200);
|
||||
return json_encode(['status' => 'success','code' => 200, 'message'=>'Email Sent Successfully...','data' => $mail,],200);
|
||||
} else {
|
||||
return json_encode(['status' => 'failed','code' => 404,'message'=>'Email Sent Failed...','data' => $email ],404);
|
||||
return json_encode(['status' => 'failed','code' => 404,'message'=>'Email Sent Failed...','data' => $mail ],404);
|
||||
}
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
return json_encode(['status' => 'failed','code' => 500,'data' => $email],500);
|
||||
return json_encode(['status' => 'failed','code' => 500,'data' => $mail],500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -156,4 +156,8 @@
|
||||
"ordering": false
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user