Comment Reply Email notification means: You reply to a comments, a will receive the corresponding email notification.
Create a new plugin, only need a PHP file on it.
First, add_action.
Add_action (' Comment_post ', ' comment_notify ');
Then implement our Send mail function. The main is based on the WordPress API to obtain relevant information, and then call the Wp_mail function to send.
Modifying the source email address can be modified in header:
$message _headers = ' from:acm house <no-reply@acmerblog.com> '. "\r\n\\";
Note the distinction between comment and old_comment. The latter refers to comments that have been returned.
Here on my website the ACM home www.acmerblog.com as an example:
<?php add_action (' comment_post ', ' comment_notify ');
function comment_notify ($comment _reply_id) {$comment = Get_comment ($comment _reply_id);
if ($comment->comment_parent!= 0) {$old _comment = get_comment ($comment->comment_parent);/replied comments if ($old _comment->user_id = = 0) {$email = $old _comment->comment_author_email;
A reviewer's mailbox, as the destination address $name = $comment->comment_author;
$content = $comment->comment_content;
$post = Get_post ($comment->comment_post_id);
$title = $post->post_title;
$link = Get_permalink ($comment->comment_post_id); $bname =get_option (' blogname '); Get to the name of the website, ACM House.
Here is no use of this variable, the back directly written dead $blogname = Wp_specialchars_decode ($bname, ent_quotes); $subject = sprintf (' [%1 $ s] replied to you in [%2$s] ', $name, $title);
The subject of the message//$subject = sprintf (' [%1 $ s] Comment reply: "%2$s", $blogname, $title); $notify _message = sprintf (' Your comments in '%s ' haveNew reply ', $title).
"\ r \ n"; $notify _message. = sprintf (' Reviewer:%1 $ s ', $name).
"\ r \ n"; $notify _message. = ' Comment content: '. "\ r \ n". $content.
"\r\n\r\n"; $notify _message. = ' You can view the comments in this article here: '.
"\ r \ n"; $notify _message. = $link.
"#comments \r\n\r\n"; $message _headers = ' from:acm house <no-reply@acmerblog.com> '. "\r\n\\"; The header application can change the source address of the message $message _headers. = "Content-type:text/plain; Charset=\ "". Get_option (' Blog_charset ').
"\ \ n";
Wp_mail ($email, $subject, $notify _message, $message _headers); }}}?>