[eluser]anyamanggar[/eluser]
The logic is like this :
visitor --- web -- database -- email -- admin
its work for my code like this :
Code:
public function buat_tanya_jawab(){
$this->load->model('tanyajawab_model');
$this->load->library('form_validation');
$this->load->helper('form');
$this->load->helper('url');
$this->form_validation->set_rules('tanyajawab_nama', 'tanyajawab_nama', 'required');
$this->form_validation->set_rules('tanyajawab_email','tanyajawab_email', 'required');
$this->form_validation->set_rules('tanyajawab_judul','tanyajawab_judul', 'required');
$this->form_validation->set_rules('tanyajawab_isi','tanyajawab_isi','required');
$this->form_validation->set_message('required','Silahkan isi terlebih dahulu');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
if ( $this->form_validation->run() == TRUE) {
$this->load->library('email');
$config['protocol'] = 'mail';
$config['mailtype'] = 'text';
$config['charset'] = 'utf-8';
$config['wordwrap'] = FALSE;
$this->email->initialize($config);
// setting form untuk penerimana kita jadikan variabel
$to = "[email protected]";
$from = "[email protected]";
$name = $this->input->post('tanyajawab_nama');
$email = $this->input->post('tanyajawab_email');
$judul = $this->input->post('tanyajawab_judul');
$pesan = $this->input->post('tanyajawab_isi');
$mail_message = '
Name: ' .$name. '
Email: '.$email. '
Judul: '.$judul. '
Message: '.$pesan;
$this->email->from('[email protected]', 'Galenium');
$this->email->to('[email protected]');
$this->email->subject('enquiry');
$this->email->message($mail_message);
$this->email->send();
$this->tanyajawab_model->create();
redirect('list_tanya_jawab');
}
the problem is i dont know what i have suppose todo if admin reply with email, and data input to database and will show in frontend the data
the logic is maybe like this :
admin send email and data save to database and will show on the web and visitor will recieve email
please i will appriciate if somebody can help me .. thank you