-
/** -
*WordPress Tutorial: Notify reviewers by email after review -
* http://wosn.net/490.html -
*/ -
add_action('comment_unapproved_to_approved', 'wosn_net_comment_approved'); -
function wosn_net_comment_approved( $comment ){ -
if (is_email( $comment ->comment_author_email)){ -
$post_link = get_permalink( $comment ->comment_post_ID); -
$title ='Your comment on ['. get_bloginfo ('name ').'] has been approved '; -
$body ='In the<a href= "' . $post_link . '" target= "_blank" >' . get_the_title( $comment ->comment_post_ID) . '</a>has passed the review< br /><br />'; -
$body .= '<strong>Your comments:</strong><br/>'; -
$body .= strip_tags ( $comment ->comment_content) . '<br /><br />'; -
$body .= 'You can:<a href= "' . get_comment_link($comment->comment_ID) . '" target= "_blank" >View your comments</a>|<a href= "' . $post_link . '#comments" target= "_blank" >View other comments</a>|<a href= "' . $post_link . '" target= "_blank" >Read the article again</a><br/><br/>'; -
$body .= 'Welcome back [<a href= "' . get_bloginfo('url') . '" target= "_blank" title= "' . get_bloginfo('description') . '" >' . get_bloginfo('name') . '</a>】。'; -
$body .= '<br/><br/>Note: This email is automatically sent by the system, please do not reply directly'; -
@wp_mail( $comment ->comment_author_email, $title , $body , "Content-Type: text/html; charset=UTF-8" ); -
} -
}