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
|
// send purhase data through mail
|
||||||
$VendorModel = new VendorModel();
|
$VendorModel = new VendorModel();
|
||||||
$vendor = $VendorModel->where('vendor_id',$this->request->getPost('vendor_id'))->findAll();
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -455,6 +457,7 @@ public function download_purchase_invoice($purchase_order_id, $mail = null)
|
|||||||
{
|
{
|
||||||
unlink($pdfFilePath);
|
unlink($pdfFilePath);
|
||||||
}
|
}
|
||||||
|
return json_decode($mail_response)->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class MailHelper
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$email = $params['mail'];
|
$mail = $params['mail'];
|
||||||
$subject = $params['subject'];
|
$subject = $params['subject'];
|
||||||
$message = $params['message'];
|
$message = $params['message'];
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ class MailHelper
|
|||||||
$email->setMailType('html');
|
$email->setMailType('html');
|
||||||
$email->setFrom('bbone@venbait.in', 'The Mechnaic');
|
$email->setFrom('bbone@venbait.in', 'The Mechnaic');
|
||||||
|
|
||||||
$email->setTo($email);
|
$email->setTo($mail);
|
||||||
|
|
||||||
$email->setSubject($subject);
|
$email->setSubject($subject);
|
||||||
$email->setMessage($message);
|
$email->setMessage($message);
|
||||||
@ -32,13 +32,13 @@ class MailHelper
|
|||||||
if(isset($params['attachment'])) { $email->attach($params['attachment']); }
|
if(isset($params['attachment'])) { $email->attach($params['attachment']); }
|
||||||
|
|
||||||
if ($email->send()) {
|
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 {
|
} 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) {
|
} catch (\Throwable $e) {
|
||||||
return json_encode(['status' => 'failed','code' => 500,'data' => $email],500);
|
return json_encode(['status' => 'failed','code' => 500,'data' => $mail],500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,3 +157,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user