首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何根据codeigniter中的单选按钮值发送邮件?

如何根据codeigniter中的单选按钮值发送邮件?
EN

Stack Overflow用户
提问于 2017-02-09 17:36:41
回答 1查看 242关注 0票数 0

我的application..in中有一个选择表单,它有四个字段,一个是选择、注释、结果,还有两个单选按钮,分别为selected和selected。

所以我想要做的是,当某人单击selected单选按钮时,我需要send selected mail..if单选按钮需要send mail not selected mail。

我的控制器代码:

代码语言:javascript
复制
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";
            }
        }

请告诉我怎么做..

谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-02-09 18:03:04

以下是解决方案:

if($data‘process_process’==1)

{

//发送选中的邮件

}

否则

{

//发送未选中的邮件

}

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42133002

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档