Multisite: How to bypass wpmu_signup_user_notification and add my own notification logic?

This is actually quite easy. All I needed was to inject the appropriate add_filter() and follow it up with my custom function. That’s all I needed to completely override the original function. So sweeet.

To bypass wpmu_signup_user_notification() and use my own custom function I needed the following:

add_filter('wpmu_signup_user_notification', 'gqa_signup_user_notification', 10, 4);

And in my custom function I actually just copied the entire function from ms-function.php and only changed the part I needed to change (the $admin_email variable), but I could have entirely rewritten it had I needed to.

I don’t know what WPMU functions behave in this way, or why they didn’t just make them pluggable, but whatevs, I’m happy to have this kind of control.

FWIW I was also able to do the same with wpmu_welcome_user_notification.