function approve_pos($id) { if (isset($this->session->userdata['user'])) { $pos = $_POST['pos']; $has_superviser = false; if ($this->session->userdata['user_type'] == 3) { if ($this->has_store_superviser()) { $has_superviser = true; } } else { if ($this->has_user_superviser()) { $has_superviser = true; } } if ($has_superviser) { foreach ($pos as $key => $item) { $this->orders_model->add_pos($key, mysql_escape_string($item)); } } else { foreach ($pos as $key => $item) { $this->orders_model->approve_pos($key, mysql_escape_string($item)); $verif_code = md5(time()); $this->status_model->insert($key, 0, $verif_code); $mailer = new phpmailer(); $mailer->IsSendmail(); $mailer->From = '*****@*****.**'; $mailer->FromName = 'Belron admin'; $mailer->Subject = utf8_decode('Nouvelle commande ajoutée'); $email_message = "Une nouvelle commande vient d'être ajoutée <br/> \n Pour confirmer la receprion :<a href='" . base_url() . "orders/recieved/" . $key . "/" . $verif_code . "/'>" . base_url() . "orders/recieved/" . $key . "/" . $verif_code . "/ </a><br/>\n Pour confirmer le traitement :<a href='" . base_url() . "orders/submit/" . $key . "/" . $verif_code . "/'>" . base_url() . "orders/submit/" . $key . "/" . $verif_code . "/ </a><br/>\n Pour confirmer l'envoie :<a href='" . base_url() . "orders/send/" . $key . "/" . $verif_code . "/'>" . base_url() . "orders/send/" . $key . "/" . $verif_code . "/ </a>"; $mailer->MsgHTML($email_message); $mailer->AddAddress('*****@*****.**', 'Skander Jabouzi'); $mailer->Send(); } } redirect('wishlist/confirmation/'); } else { redirect('login/storelogin'); } }
private static function alertComment(Comments $comment) { require_once '../classes/utilities/class.phpmailer.php'; $mail = new phpmailer(); $mail->IsSendmail(); $mail->FromName = "Comments"; $mail->From = '*****@*****.**'; $mail->Subject = "Comment by {$comment->userName} awaiting approval."; $mail->Host = $_SERVER['SERVER_NAME']; $mail->Body = "Comment Body:\n" . $comment->body; $mail->AddAddress("*****@*****.**", "Comment Notifier"); $mail->Send(); }
function sendMail($name, $subject, $data, $email) { $mail = new phpmailer(); $mail->IsSendmail(); $mailBody = "From: {$name}\nEmail: {$email}\n{$data}"; $mail->FromName = $name; $mail->From = '*****@*****.**'; $mail->Subject = $subject; $mail->Host = $_SERVER['SERVER_NAME']; $mail->Body = $mailBody; $mail->AddAddress("*****@*****.**", "Site Questions"); $status = $mail->Send(); return $status; }
function request_cancel($order_id) { $order_status = $this->status_model->get($order_id); $problems = $_POST['problems']; $mailer = new phpmailer(); $mailer->IsSendmail(); $mailer->From = '*****@*****.**'; $mailer->FromName = 'Belron admin'; $mailer->Subject = utf8_decode('Demande pour annuler pour une demande'); $email_message = "Une demande pour annuler une demande : <br/><br/>"; foreach ($problems as $problem) { $email_message .= $problem . "<br/>"; } $email_message .= "Pour confirmer l'annulation :<a href='" . base_url() . "orders/cancel/" . $order_id . "/" . $order_status[0]->code_verif . "/'>" . base_url() . "orders/cancel/" . $order_id . "/" . $order_status[0]->code_verif . "/ </a><br/>"; $mailer->MsgHTML($email_message); $mailer->AddAddress('*****@*****.**', 'Skander Jabouzi'); $mailer->Send(); redirect('orders/request_confirmation'); }
function request_price() { $mailer = new phpmailer(); $mailer->IsSendmail(); $mailer->From = '*****@*****.**'; $mailer->FromName = 'Belron admin'; $mailer->Subject = utf8_decode('Demande pour pour revision de prix : #') . $_POST['id']; $email_message = "Une demande pour revision de prix : #{$_POST['id']}<br/><br/>"; foreach ($problems as $problem) { $email_message .= $_POST['price_request'] . "<br/>"; } $email_message .= "La page du produit : <a href='" . base_url() . "productsmanager/edit/" . $_POST['id'] . "/'>" . base_url() . "productsmanager/edit/" . $_POST['id'] . "/ </a><br/>"; $mailer->MsgHTML($email_message); $mailer->AddAddress('*****@*****.**', 'Skander Jabouzi'); $mailer->Send(); redirect('orders/request_confirmation'); }
private static function alertWhoops($post) { require_once '../classes/utilities/class.phpmailer.php'; ob_start(); var_dump($post); $data = ob_get_clean(); $mail = new phpmailer(); $mail->IsSendmail(); $mail->FromName = "FuckUps"; $mail->From = '*****@*****.**'; $mail->Subject = "something f****d up"; $mail->Host = $_SERVER['SERVER_NAME']; $mail->Body = $data; $mail->AddAddress("*****@*****.**", "Comment Notifier"); $mail->Send(); }