admin管理员组文章数量:1023772
I would like the site's administrator doesn't receive a new user's registration email when the administrator himself uses the admin interface to add a user.
How can I limit sending a email only when a user completes the registration form ?
// If the registration form was completed by a user ...
add_action( 'user_register', 'user_registration_save', 10, 1 );
function user_registration_save( $user_id ) {
$to = '';
$subject = 'New register with the form';
$message .= "Identifiant : " . $user->user_login . "\r\n\r\n";
$message .= "E-mail : " . $user->user_email;
wp_mail( $to, $subject, $message );
}
I would like the site's administrator doesn't receive a new user's registration email when the administrator himself uses the admin interface to add a user.
How can I limit sending a email only when a user completes the registration form ?
// If the registration form was completed by a user ...
add_action( 'user_register', 'user_registration_save', 10, 1 );
function user_registration_save( $user_id ) {
$to = '';
$subject = 'New register with the form';
$message .= "Identifiant : " . $user->user_login . "\r\n\r\n";
$message .= "E-mail : " . $user->user_email;
wp_mail( $to, $subject, $message );
}
本文标签: Email notification after registration in Wordpress
版权声明:本文标题:Email notification after registration in Wordpress 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745554455a2155787.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论