New user notification doesn’t include activation link

WordPress 4.9.0 introduced 2 filters into the new user notification mail function (wp_new_user_notification):

  • wp_new_user_notification_email – to customise the email sent to User
  • wp_new_user_notification_email_admin – to customise the email email sent to Admin

We can ignore the second as this is the email sent to the admin the format is different from that in your question. wp_new_user_notification_email on the other hand allows you to modify the ‘to’, ‘subject’, ‘message’ and ‘headers’ before these are sent to the wp_mail() function.

However, you intercepted the wp_mail filter which fires immediately after wp_new_user_notification_email and everything looks fine at that point, so the issue must be later. The only remaining place that the message could be filtered is through the wp_mail filter.

If you are convinced that there is no issue with charset or client side email, then look for any other calls to add_filter(‘wp_mail’, …). Also check out the source code of the email received.

Sorry I can’t be more help. This is an interesting question and I look forward to hearing finally what the solution is or any other suggestions.