[英]How to send mail depending on radio button value in codeigniter?
I have one selection form in my application..in that i have four fields one is selection,comments,results,and two radio buttons with selected and selected.. 我在我的应用程序中有一个选择表单。在我有四个字段的地方,一个是选择,注释,结果,还有两个单选按钮,分别为selected和selected。
So what I want to do is when person clicked on the selected radio button I need to send selected mail..if person selected not selected radio button need to send mail not selected mail.. 所以我想做的是,当某人单击选定的单选按钮时,我需要发送选定的邮件。如果选定的人未选定的单选按钮,则需要发送未选定的邮件。
My Controller code : 我的控制器代码:
public function requirement()
{
$this->load->model('RequirementModel');
$data['user'] = $this->RequirementModel->getusers();
$this->load->view('Requirements/requirements', $data);
$insert = array(
'role_name' => $this->input->post('role_name'),
'vacancies' => $this->input->post('vacancies'),
'experience' => $this->input->post('experience'),
'jd' => $this->input->post('jd'),
'hiring_contact_name' => $this->input->post('hiring_contact_name'),
'hiring_contact_number' => $this->input->post('hiring_contact_number'),
'user_id' => implode(',', $this->input->post('user_id')),
);
$this->RequirementModel->add_requirement($insert);
$all_users = $this->input->post('user_id');
foreach ($all_users as $key) {
$get_email = $this->RequirementModel->get_user_email_by_id($key);
$role_name = $this->input->post('role_name');
$vacancies = $this->input->post('vacancies');
$experience = $this->input->post('experience');
$jd = $this->input->post('jd');
$hiring_contact_name = $this->input->post('hiring_contact_name');
$hiring_contact_number = $this->input->post('hiring_contact_number');
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://md-in-42.webhostbox.net',
'smtp_port' => 465,
'smtp_user' => 'test3@clozloop.com',
'smtp_pass' => 'test3',
);
$this->load->library('email', $config);
$this->email->set_mailtype("html");
$this->email->from('test3@clozloop.com', 'bharathi');
$this->email->to($get_email);
$this->email->subject('this is our requirements pls go through it');
$link = 'Click on this link - <a href="http://localhost/job_portal/index.php/Login/signin">Click Here</a>';
$this->email->message($link);
// $this->email->message("Dear,\n\nRole Name:$role_name, Vacancies:$vacancies,experience:$experience,jd:$jd,hiring_contact_number:$hiring_contact_number,hiring_contact_name:$hiring_contact_name.\n\nThanks, \nGlobaalign.");
//$this->email->send();
//print_r($get_email);
if ($this->email->send()) {
echo "email sent";
} else {
echo "email failed";
}
}
please help me how to do this.. 请帮我怎么做..
Thank you 谢谢
Here is the solution: 解决方法如下:
if($data['selection_process']==1) 如果($数据[ 'selection_process'] == 1)
{ {
//send selected mail //发送选定的邮件
} }
else 其他
{ {
//send not selected mail //发送未选择的邮件
} }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.