Comment Notifier カスタマイズ
新規コメント(承認待ち、公開)時のメール通知プラグイン「Comment Notifier」のメール通知の内容をカスタマイズ。
新規コメント通知のメールフォーマットを
From:(コメント投稿者)(コメント投稿者E-mail)
Subject:(ブログ名)返信:(記事タイトル)
Body:(コメント投稿者)さんより
(記事タイトル)に返信がありました
返信内容:(コメント内容)
返信内容を確認:(コメントURL)
にしたいので、
comments-notifier.phpの232〜246行目
$notify_message = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";
$notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
から
$subject = apply_filters('comment_notification_subject', $subject, $comment_id);
$message_headers = "MIME-Version: 1.0\n"
. "$from\n"
までを
$notify_message = sprintf( __('%1$s さんより'), $comment->comment_author ) . "\r\n";
$notify_message .= sprintf( __('「%1$s」に返信がありました'), $post->post_title ) . "\r\n\r\n";
$notify_message .= __('返信内容:') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= __('返信内容を確認:') . "\r\n";
$subject = sprintf( __('[%1$s] 返信:%2$s'), $blogname, $post->post_title );
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
$notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id);
$subject = apply_filters('comment_notification_subject', $subject, $comment_id);
$message_headers = "MIME-Version: 1.0\n"
. "From: $comment->comment_author <$comment->comment_author_email> \n"
に差し替え
