/** * 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; }
public function registerNotify($custtomer_id) { $customerModel = new BookProModelCustomer(); $this->customer = $customerModel->getComplexItem($custtomer_id); $body_admin = $this->config->sendRegistrationsBodyAdmin; $body_customer = $this->config->sendRegistrationsBodyCustomer; $body_customer = $this->fillCustomer($body_customer); $body_admin = $this->fillCustomer($body_admin); if ($this->config->sendRegistrationsEmails = 1 || ($this->config->sendRegistrationsEmails = 3)) { BookProHelper::sendMail($this->config->sendRegistrationsEmailsFrom, $this->config->sendRegistrationsEmailsFromname, $customer->email, $this->config->sendRegistrationsEmailsSubjectCustomer, $body_customer, true); } if ($this->config->sendRegistrationsEmails = 1 || ($this->config->sendRegistrationsEmails = 2)) { BookProHelper::sendMail($config->sendRegistrationsEmailsFrom, $config->sendRegistrationsEmailsFromname, $config->sendRegistrationsEmailsFrom, $config->sendRegistrationsEmailsSubjectAdmin, $body_admin, $htmlMode); } }