在codeigniter的查看页面上单击按钮时,向特定用户发送邮件 [英] send a mail to particular user while clicking on the button from view page in codeigniter

查看:41
本文介绍了在codeigniter的查看页面上单击按钮时,向特定用户发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视图页面,称为供应商视图候选者页面"..在该页面中,我显示了数据库中的所有候选者详细信息,而我在该视图页面中具有了user_id..并且当用户单击时,我给出了一个名为发布信息"的按钮.该页面上的按钮将重定向到具有该特定候选人编号的edit_candidates页面.他们将允许插入电子邮件和电话号码.

i have one view page called vendor view candidates page..in that page i display all the candidates details from database and i have user_id in that view page..and i gave button called release information..so when user click on the button the page will redirect to edit_candidates page with that particular candidate_id..and they will allow to insert email and phone number..

在他们输入电子邮件和手机号码后提交..我想将邮件发送到特定的user_id.

After they insert email and mobile number and then submit..i want to send mail to particular user_id..

这是我的按钮:((编辑候选人页面)

This is my button:(edit candidates page)

<td><a href="<?php echo base_url(); ?>index.php/Candidate/edit_candidates/<?php echo $idata->candidate_id;?>" class="btn btn-info view_col">Release Contact Info</a></td>

控制器:

public function edit_candidates($id)
{
$data['editdata']=$this->CandidateModel->candidate($id);
if($this->input->post())
{
$this->CandidateModel->update_candidate($this->input->post(),$id);
redirect(base_url('index.php/Candidate/vendor_view_candidates'));
}
$this->load->view('Candidates/edit_candidate',$data);
}

任何人都可以帮我...我做了很多尝试..但是我对如何做到这一点一无所知.

Can anyone help me...i tried a lot..but i didn't get any idea on how to do this..

先谢谢了.

推荐答案

使用以下代码解决您的问题

Use the following code to fix your issue

public function edit_candidates($id)
{ 
    $data['editdata']=$this->CandidateModel->candidate($id); 
    if($this->input->post('update_form'))
    { 
        $userEmail = $this->CandidateModel->get_userinfo($data['editdata']->user_id); 
        //Pass this $userEmail into mail function it will send email

        $this->CandidateModel->update_candidate($this->input->post(),$id); 
        redirect('index.php/Candidate/vendor_view_candidates','refresh'); 
    }
    else
    {
        $this->load->view('Candidates/edit_candidate',$data); 
    }
}

让我知道它是否可以解决您的问题

Let me know if it not fix your issue

这篇关于在codeigniter的查看页面上单击按钮时,向特定用户发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆