public function save(CustomerModel $customer) { try { $sql = "INSERT INTO {$this->dbTable} (" . self::$SSNColumn . "," . self::$FirstNameColumn . "," . self::$LastNameColumn . "," . self::$emailColumn . ") VALUE (?,?,?,?)"; $params = array($customer->getSSN(), $customer->getFirstName(), $customer->getLastName(), $customer->getEmail()); $query = $this->database->prepare($sql); $query->execute($params); } catch (\PDOException $e) { return false; } }
private function sendCustomerEmail(CustomerModel $customer, OrderModel $order) { $orderId = $order->getId(); $to = $customer->getEmail(); $subject = 'Your order!'; $message = 'Receipt'; $headers = 'From: itzys webshop'; if (mail($to, $subject, $message, $headers)) { return true; } else { return false; } }