佚名 向大家介绍了wordpress邮件设置,wordpress邮件插件,wordpress发送邮件,wordpress注册邮件,wordpress 邮件等相关知识,希望对您有所帮助
一、添加一个存储投稿者邮箱的自定义栏目
打开WordPress添加投稿功能,下面我们将对这篇文章中的代码进行修改。在第二段代码第78行插入以下代码:
// 其中 ludou_tougao_email 是自定义栏目的名称 add_post_meta($status, 'ludou_tougao_email', $email, TRUE);
二、添加提醒功能php代码
在主题目录下的functions.php添加以下php代码(将以下代码中的露兜博客名称和URL改成你自己的):
function tougao_notify($mypost) { $email = get_post_meta($mypost->ID, "ludou_tougao_email", true); if( !empty($email) ) { // 以下是邮件标题 $subject = '您在露兜博客的投稿已发布'; // 以下是邮件内容 $message = ' <p><strong>露兜博客</strong> 提醒您: 您投递的文章 <strong>' . $mypost->post_title . '</strong> 已发布</p> <p>您可以点击以下链接查看具体内容:<br /> <a href="' . get_permalink( $mypost->ID ) . '">点此查看完整內容</a></p> <p>===================================================================</p> <p><strong>感谢您对 <a href="http://www.weikejianghu.com" target="_blank">露兜博客</a> 的关注和支持</strong></p> <p><strong>该信件由系统自动发出, 请勿回复, 谢谢.</strong></p>'; add_filter(