Created
April 13, 2018 19:26
-
-
Save kaoru-fukusato/2aa366fc0649c3b66aa5c39e15ccc409 to your computer and use it in GitHub Desktop.
メールアドレスがwordpress@ドメイン名になってしまう時の対応【Subscribe2】
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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