wp-includes / plugable.phpにある関数によって、新しいユーザー通知メールが作成されて送信されますwp_new_user_notification()。
この機能には、電子メールの出力を操作できるフィルターフックはありませんが、プラグインを介してプラグ可能な関数を上書きできます。
注 -プラグイン可能な関数はプラグイン内からのみ上書きでき、テーマ内からは上書きできません。
プラグ可能な関数の詳細と利用可能な関数の完全なリストについては、ここを参照してください-http://codex.wordpress.org/Pluggable_Functions
このコードは、wp-includes / plugable.phpのプラグインの代わりに使用されるプラグインを作成します(wp-content / plugins /の独自のファイルに保存します)。
私はあなたのためにそれをカスタマイズしていませんが、これはあなたをあなたの道に連れて行くはずです。
<?php
/**
 * Plugin Name: Custom new user notification email
 * Description: Overwrites the pluggable 'wp_new_user_notification()' plugin to allow the sending of a custom email
 * Author: David Gard
 * Version: 1.0
 */
if ( !function_exists('wp_new_user_notification') ) :
/**
 * Pluggable - Email login credentials to a newly-registered user
 *
 * A new user registration notification is also sent to admin email.
 *
 * @since 2.0.0
 *
 * @param int    $user_id        User ID.
 * @param string $plaintext_pass Optional. The user's plaintext password. Default empty.
 */
function wp_new_user_notification($user_id, $plaintext_pass = ''){
    $user = get_userdata($user_id);
    // The blogname option is escaped with esc_html on the way into the database in sanitize_option
    // we want to reverse this for the plain text arena of emails.
    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    $message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
    $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
    $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
    @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
    if ( empty($plaintext_pass) )
        return;
    $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
    $message .= wp_login_url() . "\r\n";
    wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
endif;