/** * Sends an email receipt to customer * * @param CustomerOrder $order * @return bool * @todo Make subject configurable * @todo Make tempalte more generic */ public function emailCustomer($order) { $subject = 'Thank you for order on ' . date('Y-m-d' . '!') . ' from website'; $from = SS_SEND_EMAIL_FROM; $to = $this->Email; $email = new Email(); $email->setFrom($from)->setTo($to)->setSubject($subject)->setTemplate('CustomerEmail')->populateTemplate(new ArrayData(array('Customer' => $order->Customer(), 'CartItems' => $order->OrderItems(), 'ShippingCostTotal' => $order->shippingcost(), 'CartTotal' => $order->TotalAmount))); // $email->populateTemplate($order); $email->send(); }