/**
  * Save subject.
  *
  * @param boolean $apply true state on edit page, false return to browse list
  */
 function sendemail()
 {
     AImporter::model('customer', 'order', 'application');
     $body_customer = JFile::read(JPATH_COMPONENT_ADMINISTRATOR . DS . 'templates' . DS . 'emailconfirm.html');
     $amount = JRequest::getVar('amount');
     $order_id = JRequest::getVar('order_id');
     $orderModel = new BookProModelOrder();
     $applicationModel = new BookProModelApplication();
     $customerModel = new BookProModelCustomer();
     //$orderModel->setId($order_id);
     $order = $orderModel->getItem($order_id);
     //getObject();
     $customerModel->setId($order->user_id);
     $customer = $customerModel->getObject();
     $app = $applicationModel->getObjectByCode($order->type);
     AImporter::helper('email');
     $body_customer = EmailHelper::fillCustomer($body_customer, $customer);
     $body_customer = EmailHelper::fillOrder($body_customer, $order);
     $payment_link = JURI::root() . 'index.php?option=com_bookpro&task=paymentredirect&controller=payment&order_id=' . $order->id;
     $body_customer = str_replace('{payment_link}', $payment_link, $body_customer);
     $order->order_status = "CONFIRMED";
     $order->store();
     BookProHelper::sendMail($this->app->email_send_from, $app->email_send_from_name, $customer->email, $app->email_customer_subject, $body_customer, true);
     $this->setRedirect(JURI::root() . '/administrator/index.php?option=com_bookpro&view=orders');
     return;
 }
示例#2
0
 public function changeOrderStatus($order_id)
 {
     $orderModel = new BookProModelOrder();
     $applicationModel = new BookProModelApplication();
     $customerModel = new BookProModelCustomer();
     $order = $orderModel->getItem($order_id);
     $customer = $customerModel->getItem($order->user_id);
     $this->app = $applicationModel->getItemByCode($order->type);
     $msg = 'COM_BOOKPRO_ORDER_STATUS_' . $order->order_status . '_EMAIL_BODY';
     $body_customer = JText::_($msg);
     $body_customer = $this->fillCustomer($body_customer, $customer);
     $body_customer = $this->fillOrder($body_customer, $order);
     BookProHelper::sendMail($this->app->email_send_from, $this->app->email_send_from_name, $customer->email, JText::_('COM_BOOKPRO_ORDER_STATUS_CHANGE_EMAIL_SUB'), $body_customer, true);
 }