给自己的最近网上赚钱的渠道_WordPress添加一个简洁的评论回复邮件模板,让用户收到来自你网站的回复邮件通知的时候也感受到你的澳门快乐12走势图表_澳门快乐12走势图基本图_花少钱中大奖-清新。废话不多了开始动手
把下面代码放到functions.php里,?>之前,(P.S. 如果之前有评论回复邮件的话,就把它覆盖掉)
//评论回复邮件 function comment_mail_notify($comment_id) { $comment = get_comment($comment_id); $parent_id = $comment->comment_parent ? $comment->comment_parent : ''; $spam_confirmed = $comment->comment_approved; if (($parent_id != '') && ($spam_confirmed != 'spam')) { $wp_email = 'no-reply@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));//发件人e-mail地址 $to = trim(get_comment($parent_id)->comment_author_email); $subject = '您在 [' . get_option("blogname") . '] 的留言有了回复'; $message = '> 您在 ' . get_option('blogname') . ' 博客最近网上赚钱的渠道上的留言有回复啦!' . trim(get_comment($parent_id)->comment_author) . ' 同学,您曾在文章《' . get_the_title($comment->comment_post_ID) . '》上发表评论:' . nl2br(get_comment($parent_id)->comment_content) . '' . trim($comment->comment_author) . ' 给您的回复如下:' . nl2br($comment->comment_content) . '您可以点击 查看回复的完整內容 ,欢迎再次光临 ' . get_option('blogname') . ' 。'; $from = "From: \"" . get_option('blogname') . "\" <$wp_email>"; $headers = "$from\nContent-Type: text/html; charset=" . get_option('blog_charset') . "\n"; wp_mail( $to, $subject, $message, $headers ); //echo 'mail to ', $to, ' ' , $subject, $message; // for testing } } add_action('comment_post', 'comment_mail_notify');
楼下是疯子。哈哈
好文章!666,学习了
楼下是疯子。哈哈
楼下是疯子。哈哈
地
楼下是疯子。哈哈
有没有预览?
木有,抱歉