2012-04-19 7 views
0

나는 wordpress MU 사이트에서 일하고 있습니다. 도메인 매핑 플러그인을 사용하고 있습니다. 이제 관리자가 수신하는 알림 이메일의 내용을 수정하고 싶습니다. 누군가가 sites.I에 등록하고 인터넷에서 검색하고 wp 설치의 wp-includes 폴더에서 pluggable.php의 기능을 찾았습니다.하지만 이벤트를 재정의하면 메일 내용은 여전히 ​​동일합니다.누군가가 Wordpress MULTISITE에 등록 할 때 관리자가받는 알림 이메일을 편집하는 방법

if (!function_exists('wp_new_user_notification')) { 
function wp_new_user_notification($user_id, $plaintext_pass = '') { 
    $user = new WP_User($user_id); 

    $user_login = stripslashes($user->user_login); 
    $user_email = stripslashes($user->user_email); 

    $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n"; 
    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; 
    $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; 
    $message .= "Testing message" . "\r\n"; 

    @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); 

    if (empty($plaintext_pass)) 
     return; 

    $message = __('Hi there,') . "\r\n\r\n"; 
    $message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "\r\n\r\n"; 
    $message .= wp_login_url() . "\r\n"; 
    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n"; 
    $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n\r\n"; 
    $message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "\r\n\r\n"; 
    $message .= __('Adios!'); 

    wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message); 

} 

} 어떤 도움이 appriciated.Thanks 될 것

: 여기 코드입니다!

답변

0

wp_mail 후크에 연결하십시오.

후크 기능 내에서 내용을 확인할 수 있으며 변경할 수 있습니다.

+0

는 그래, 난 내가 이메일에 reelecting되지 않은 변경 한 내용이 흥미있는 사실은 내가 플러그에서 삭제 기능이 테스트의 목적이다 content.And function.But을 덮어 작은 플러그인을 만들었습니다. PHP는 파일을 누른 다음 알림 전자 메일도 오는 오류가 표시됩니다. –

+0

후크 기능에 문제가있는 것 같습니다. 코드를 게시 할 수 있습니까? – Sudar

+0

이 플러그인을 발견했으나 나에게 적합하지 않습니다. remove_action ('wpmu_new_user', 'newuser_notify_siteadmin'); add_action ('wpmu_new_user', 'newuser_notify_siteadmin_enhanced'); 기능 newuser_notify_siteadmin_enhanced ($의 USER_ID) { \t/* 일부 메일 링 기능 */ }는 suggestion.But에 대한 –

1

귀하의 테마 functions.php에서이 기능을 무시하려고한다고 가정합니다. pluggable.php 전에 플러그인이로드되므로 플러그인에서 플러그인을 사용해야합니다.

https://wordpress.stackexchange.com/questions/15304/how-to-change-the-default-registration-email-plugin-and-or-non-plugin

+0

많은 감사 나는 이미이 링크를 확인하고 제안 플러그인하지만 wp_new_user_notification에 대한 –

+0

검색 :-(행운을 만들었습니다 WordPress의 파일에는 이미이 기능을 재정의 한 다른 플러그인이있을 수 있습니다. – soju