Option to only send user email
-
I’m also using the WordPress Social Login plugin, which sends its own Admin email notification when a user registers via Facebook, Google, etc…
To force this plugin to also send a user welcome email, I had to add the following hook:
add_action('wsl_hook_process_login_after_wp_insert_user', 'ss_after_social_login'); function ss_after_social_login($userId, $provider, $userProfile) { wp_new_user_notification($userId, false, 'user'); }
This calls your pluggable
wp_new_user_notification
function. Notice how I’m passinguser
as the third parameter. It would be amazing if your plugin could use this as an option to NOT send the admin email. So the$notify
param could either[empty(admin only) | admin | user]
It should be as simple as doing this in your plugin:
if ($notify != 'user' && $settings->admin_notify_user_id) { ...
Of course other (non social) registrations would send the normal admin email.
- The topic ‘Option to only send user email’ is closed to new replies.