phpcms v9 电子邮件群发完成方式

2021-04-06 00:18 admin

phpcms v9 电子邮件群发完成方式


短视頻,自新闻媒体,达人种草1站服务

自身的网站B5实例教程网,看到许多申请注册会员后沒有电子邮箱认证,可是会员较为多,1个1个推送电子邮件很烦,因而就自身2次开发设计了1个电子邮件群发作用,如今共享给大伙儿。记得个人收藏哦!

phpcms v9电子邮件群发作用是在 客户=》会员管理方法 里边完成的,选定要推送的会员,随后电子邮件群发就可以了,如图:

 

下面是完成流程:

1.寻找phpcms v9里边phpcms/modules/member/templates/member_list.tpl.php 在97行后边加上

2.在member_list.tpl.php的网页页面里加上1段js编码

function emails()

{

var ids='';

$("input[name='userid[]']:checked").each(function(i, n){

ids += $(n).val() + ',';

});

if(ids=='') {

window.top.art.dialog({content:'',lock:true,width:'200',height:'50',time:1.5},function(){});

return false;

}

window.top.art.dialog({id:'emails'}).close();

window.top.art.dialog({title:'推送电子邮件',id:'emails',iframe:'?m=member c=member a=emails ids='+ids,width:'700',height:'400'}, function(){var d = window.top.art.dialog({id:'emails'}).data.iframe;d.$('#dosubmit').click();return false;}, function(){window.top.art.dialog({id:'emails'}).close()});

}

3.寻找phpcms/modules/member/member.php加上下面编码:

/**

* 群发电子邮件

*/

function emails()

{

if(isset($_POST['dosubmit'])) {

pc_base::load_sys_func('mail');

$ids = isset($_POST['emails']['ids']) ? explode(',', $_POST['emails']['ids']): showmessage(L('illegal_parameters'), HTTP_REFERER);

array_pop($ids);

if(!empty($ids)) {

$where = to_sqls($ids, '', 'userid');

$userarr = $this- db- listinfo($where);

$emailetitle=$_POST['emails']['title']." - bcty365";

$emailcontent=$_POST['emails']['content'];

foreach($userarr as $k = $v)

{

sendmail($v['email'],$emailetitle,$emailcontent);

}

showmessage("电子邮件推送取得成功", HTTP_REFERER, '2000', 'emails');

} else {

showmessage(L('illegal_parameters'), HTTP_REFERER, '', 'emails');

}

}else

{

$ids =$_GET['ids'];

include $this- admin_tpl('member_email');

}

}

实际效果图以下:

 

本文详细地址: