Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Registration extends CI_Controller {
- public function __construct()
- {
- parent::__construct();
- $this->load->model('Registration_model', 'registration', TRUE);
- }
- public function index()
- {
- $fullname = $this->input->post('fullname');
- $email = $this->input->post('email');
- $handphone = $this->input->post('handphone');
- $data = array(
- 'fullname' => $fullname,
- 'email' => $email,
- 'handphone' => $handphone,
- 'token' =>md5($email),
- 'active' =>0,
- 'status' =>1,
- 'datetime' =>date("Y-m-d H:i:s")
- );
- $this->registration->submitData($data);
- //$this->session->set_userdata($data);
- $encrypted_id = base_url("Verifikasi/".md5($email));
- $this->load->library('email');
- $config = array();
- $config['charset'] = 'utf-8';
- $config['useragent'] = 'Codeigniter';
- $config['protocol']= "sendmail";
- $config['mailtype']= "text";
- $config['crlf']="\r\n";
- $config['newline']="\r\n";
- $config['wordwrap'] = TRUE;
- $this->email->initialize($config);
- $this->email->to($email);
- $this->email->from('angpiyu@gmail.com', 'Hana from Homtel');
- //$this->email->bcc('tofaporayouw@gmail.com','Homtel');
- $this->email->subject("Verifikasi Email Akun Anda");
- //$body = $this->load->view('emails/verification',$content,TRUE);
- //$body = "
- //Hi ".$fullname." dengan alamat email ".$email."\r\r
- //Terima kasih atas pendaftaran Anda.\r
- //Silahkan melakukan verifikasi email Anda dengan meng-klik link dibawah
- //ini.\r
- //".$encrypted_id."
- //\r\r\r
- //Cheers,\r
- //Homtel
- //";
- $this->email->message(
- '<h1><center>Selamat Anda terverifikasi</center></h1>'
- . '<h2>Hi</h2>'
- . '<p>Nama : majid</p>'
- . '<p>email: almajidibnujazu@gmail.com</p>'
- . '<p>No.Telpon :08999000</p>'
- . 'Silahkan melakukan verifikasi email Anda dengan meng-klik link dibawah'
- . ".$encrypted_id."
- );
- if($this->email->send()) {
- redirect('registration/thankyou');
- }else{
- redirect('home');
- }
- }
- public function verification($key)
- {
- $this->load->helper('url');
- $this->registration->changeActiveState($key);
- $cekemail = $this->registration->cekemail($key);
- $email = $cekemail->email;
- $this->load->library('email');
- $config = array();
- $config['charset'] = 'utf-8';
- $config['useragent'] = 'Codeigniter';
- $config['protocol']= "sendmail";
- $config['mailtype']= "html";
- $config['crlf']="\r\n";
- $config['newline']="\r\n";
- $config['wordwrap'] = TRUE;
- $this->email->initialize($config);
- $this->email->to($email);
- $this->email->from('angpiyu@gmail.com', 'Hana from Homtel');
- //$this->email->cc('info@homtel.id', 'Hana from Homtel');
- //$this->email->bcc('tofaporayouw@gmail.com','Homtel');
- $this->email->subject("Selamat Anda masuk dalam daftar Waiting List Homtel");
- //$body = $this->load->view('emails/waitinglist');
- $body = "
- Terima kasih, anda
- Telah terverifikasi dengan baik.\r
- Team Bisnis Development Homtel akan menghubungi Anda 1x24jam.
- TERIMA KASIH
- \r\r\r
- Cheers,\r
- Homtel
- ";
- $this->email->message($body);
- if($this->email->send()) {
- //redirect('registration/thankyou');
- redirect('http://dev.homtel.asia/');
- }
- }
- public function thankyou()
- {
- $this->load->view('thankyou');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement