Skip to content

Instantly share code, notes, and snippets.

@kaoru-fukusato
Created April 13, 2018 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaoru-fukusato/2aa366fc0649c3b66aa5c39e15ccc409 to your computer and use it in GitHub Desktop.
Save kaoru-fukusato/2aa366fc0649c3b66aa5c39e15ccc409 to your computer and use it in GitHub Desktop.
メールアドレスがwordpress@ドメイン名になってしまう時の対応【Subscribe2】
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from($old) {
return 'info@hoge.jp'; // 変更したいメールアドレスを入力
}
function new_mail_from_name($old) {
return 'ほげほげ管理者';//サイト名を入力
}
//よく見ると返信先(reply-to)が wordpress@ドメイン名のままなので、これも変更
function custom_reply_to($header) {
$header['Reply-To'] = 'info@hoge.jp';
return $header;
}
add_filter('s2_email_headers', 'custom_reply_to');
//Subscribe2 独自のフィルターがあったようです。ここも以下をつけたして書いておけば、このフィルターだけでもOKな気がします。
$header['From'] = "ほげほげ管理者<info@hoge.jp>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment