0

Can please teach me which function reference should I use to modify new user email notification in network admin screen -> add user.

network-users-add-new

I want to use custom email template for notify user?

it will be very helpful if you can give example because documentation is still not complete for wordpress multisite.

0

Muhammad,

Multisite uses the same code in most cases. If you look at the function https://developer.wordpress.org/reference/functions/wp_new_user_notification/, you'll see that there are filters to change the 'message', such as 'wp_new_user_notification_email_admin' and 'wp_new_user_notification_email'.

You'll see the code includes link to "network_site_url" allowing for a new ms user.

A good way to teach oneself these things is to have multisite on a localhost, then you can tracks, search, explore the code and verify what functions are executing and see what filters are being applied and actions being 'done'.

  • Thank you for your advice, I have try to apply wp_new_user_notification but nothing happen, I try to use wpmu_ it's run well but for all site but I want this event only execute in network_admin-> add user page. Now I try to put conditionasl tag is_network_admin() (codex.wordpress.org/Function_Reference/is_network_admin) ... – Muhammad Ibrahim Jul 4 '18 at 8:00
  • HI,sorry I'm not sure what you are saying. If you want the filter to only apply to a particular site, then put the condition in your custom function.EG (pseudo code): If (blog='xyz') then change_message, else return untouched. – anmari Jul 4 '18 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.