Example #1
0
 function subscribe()
 {
     $email_id = strtolower($this->input->post('subscribe_email'));
     $data = array();
     if (valid_email($email_id)) {
         if ($this->database->Subscribe($email_id)) {
             $data['site_name'] = 'Psycho Store';
             mg_add_subscriber($email_id);
             $params = mg_create_mail_params('subscribe', $data);
             mg_send_mail($email_id, $params);
             $data['heading'] = "<small>Greetings</small> " . $email_id;
             $data['content'] = "We dont know who you are. We dont know what you want. If you are looking for toilet brushes, We can tell you we dont have any. But what we do have are a very particular set of gaming stuff. Stuff that we have made with a lot of hardwork. Stuff that can make people like you very happy. If you buy that stuff from us, that will be the end of it. We will not look for you, We will not pursue you. But if you dont, we will look for you, we will find you, and we will keep updating you.";
         } else {
             $data['heading'] = $email_id;
             $data['content'] = "We understand you love us, and you love playing around our website and subscribing to Psycho Store newsletter. But you are already in our list you know. Dont fret we wont forget you, you know. Adding your name once is enough you know. Just so you know.";
         }
     } else {
         $data['email_id'] = $email_id;
         $data['heading'] = "Damn, you cant even type an email correctly";
         $data['content'] = "Just dont disappoint this time, try again";
     }
     display('basic', $data);
 }
Example #2
0
 /**
  * Send email message of given type (activate, forgot_password, etc.)
  *
  * @param	string
  * @param	string
  * @param	array
  * @return	void
  */
 function _send_email($type, $email, &$data)
 {
     $params = mg_create_mail_params($type, $data);
     mg_send_mail($email, $params);
 }
Example #3
0
 function _shipped($txn_id)
 {
     if (is_array($txn_id) == false) {
         $txn_id = array($txn_id);
     }
     foreach ($txn_id as $key => $id) {
         $order[] = $this->database->GetOrderById($id);
         _add_address_and_user_to_orders($order);
         $order = $order[0];
         //Mark as shipped
         $this->database->UpdateOrderStatus($id, OrderState::Shipped);
         if (strlen($order['waybill']) > 0) {
             //Mail User
             $data['order_id'] = $order['txn_id'];
             $data['username'] = $order['user']['username'];
             $data['waybill'] = $order['waybill'];
             $data['tracking_address'] = $this->config->item('delhivery_url') . "/p/{$order['waybill']}";
             $data['site_name'] = $this->config->item('website_name', 'tank_auth');
             $params = mg_create_mail_params('shipped', $data);
             mg_send_mail($order['user']['email'], $params);
         }
     }
     redirect('admin/shipments');
 }