Reply To: Filtering E-mail Message Content
Yes, the above is a rather awkward solution.
Just occurred to me that you could extract the info you need from the $settings_link arg passed by the $email_content filter hook to further query the database and/or rebuild $email_content – and so avoid filtering wp_mail
I think it would be a reasonable request that the
$email_content filter hook in messages_notification_new_message include $ud.
It’s a simple change, so please submit an enhancement ticket:
https://buddypress.trac.wordpress.org/
[ We may find out that there is an existing and simple solution ! ]