Exemplo n.º 1
0
    public function sent()
    {
        $this->load->library('email');
        $body = '
			<table align="center" cellpadding="0" cellspacing="0" border="0" style="width: 600px; font-size: 12px; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;font-weight: normal;border: 1px solid #2B7FE9; ">
			<tr>
			<td style="border: 1px solid #2B7FE9;border-bottom: none; background-color: #2B7FE9"><img src="' . base_url() . 'img/top_mail.png" alt=""></td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none; border-top: none;"><h4>Customer Info</h4></td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none;"><strong>Name:</strong>&nbsp;' . formatString($this->input->post('txtContactName')) . '</td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none;"><strong>Email:</strong>&nbsp;' . $this->input->post('txtContactEmail') . '</td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none;"><strong>Phone Number:</strong>&nbsp;' . formatString($this->input->post('txtContactTlf')) . '</td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none;"><h4>Support Info</h4></td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none;"><strong>Subject:</strong>&nbsp;' . htmlentities(formatString($this->ModelContents->get_reason($this->input->post('cboContactReason'), 'name'), 2)) . '</td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;border-bottom: none;"><strong>Message</strong>&nbsp;</td>
			</tr>
			<tr>
			<td style="padding:10px;border: 1px solid #2B7FE9;">' . formatString($this->input->post('txtContactMsg'), 2) . '</td>
			</tr>
			<tr>
			<td>&nbsp;</td>
			</tr>
			</table>
		';
        $ci = get_instance();
        //_imprimir($ci->config->config['head']);
        $this->email->initialize(emailSetting());
        $this->email->from($ci->config->config['head']['no_reply'][1], $ci->config->config['head']['company']);
        $this->email->to('*****@*****.**');
        $this->email->subject(formatString($this->input->post('txtContactName')) . ' wants to cantact you!');
        $this->email->message($body);
        if (!$this->email->send()) {
            $data = ['title' => 'Error', 'message' => 'there was an error when we tried to send the email, try again.', 'debugger' => ''];
        } else {
            $data = ['title' => 'Thanks for your request!', 'message' => 'We have received your message. You will receive a message from us in 24 hours.', 'out' => 'ok', 'url' => $ci->config->config['head']['domain'] . '/content/body/contact-us', 'debugger' => ''];
        }
        echo json_encode($data);
    }
Exemplo n.º 2
0
 public function forgotPass()
 {
     $this->load->library('email');
     $this->lang->load('emails', $this->session->userdata('ws-language'));
     $user = $this->user->exists($this->input->post('mailForgot'), 'id, name, last_name, email');
     if (!$user) {
         $data = ['out' => 'notOk', 'title' => $this->lang->line('login_forgot_error_title'), 'message' => $this->lang->line('login_forgot_error_message'), 'class' => 'alert', 'title_class' => 'alert-box-title', 'debug' => ''];
     } else {
         $token = md5($user->id . '_' . $user->email . '_' . $user->id);
         $link = base_url() . 'wpanel/resetPass/' . $token;
         $content = '
             <table cellpadding="0" cellspacing="0" border="0" style="width: 100%;  font-size: 14px">
             <tr>
             <td style="padding:10px 0">' . $this->lang->line('email_reset_msg01') . '</td>
             </tr>
             <tr>
             <td style="padding:10px 0">' . $this->lang->line('email_reset_msg02') . '</td>
             </tr>
             <tr>
             <td style="padding:10px 0"><a href="' . $link . '">' . $link . '</a></td>
             </tr>
             </table>
         ';
         $body = $this->load->view('partial/email', ['config' => $this->config->config['head'], 'language' => $this->session->userdata('ws-language'), 'title' => $this->lang->line('login_forgot_title'), 'name' => formatString($user->name . ' ' . $user->last_name), 'content' => $content], true);
         $this->email->initialize(emailSetting());
         $this->email->from($this->config->config['head']['no_reply'][1], $this->config->config['head']['company']);
         $this->email->to($user->email);
         $this->email->subject($this->lang->line('login_forgot_title'));
         $this->email->message($body);
         if (!$this->email->send()) {
             $data = ['out' => 'notOk', 'title' => $this->lang->line('login_forgot_title_error_sending_email'), 'message' => str_replace('[here]', '<a href="' . base_url() . 'content/body/contact-us" style="color:#FFF; text-decoration: underline;">' . $this->lang->line('reset_here_label') . '</a>', $this->lang->line('login_forgot_msg_error_sending_email')), 'class' => 'alert', 'title_class' => 'alert-box-title', 'debugger' => ''];
         } else {
             $data = ['out' => 'ok', 'title' => str_replace('[email]', $user->email, $this->lang->line('login_forgot_ok_title')), 'message' => $this->lang->line('login_forgot_ok_message'), 'class' => 'success', 'title_class' => 'success-box-title'];
         }
     }
     echo json_encode($data);
 }
Exemplo n.º 3
0
 /**
  * emailsSuccessfullyActivated
  * Send an activation emails message to the customer.
  *
  * @param string $email, cutomer email
  */
 public function emailsSuccessfullyActivated($email = '')
 {
     $link = base_url() . 'services/myservices/';
     if ($email != '') {
         $message = $this->lang->line('services_email_message');
         $tittle = $this->lang->line('services_email_tittle');
         $name = $this->lang->line('services_email_tittle');
     } else {
         return;
     }
     $content = '
             <table cellpadding="0" cellspacing="0" border="0" style="width: 100%;  font-size: 14px">
             <tr>
             <td style="padding:10px 0">' . $tittle . '</td>
             </tr>
             <tr>
             <td style="padding:10px 0">' . $message . '</td>
             </tr>
             <tr>
             <td style="padding:10px 0"><a href="' . $link . '">' . $link . '</a></td>
             </tr>
             </table>
         ';
     $body = $this->load->view('partial/email', ['config' => $this->config->config['head'], 'language' => $this->session->userdata('ws-language'), 'title' => $tittle, 'name' => $name, 'content' => $content], true);
     $this->email->initialize(emailSetting());
     $this->email->from($this->config->config['head']['no_reply'][1], $this->config->config['head']['company']);
     $this->email->to($email);
     $this->email->subject($tittle);
     $this->email->message($body);
     $this->email->send();
 }