Adapting wp_new_user_notification
-
I’ve been experimenting with Mandrill and very pleased with the ability it gives to avoid the relatively low limits my web host places on outgoing e-mails, so hoping to make good use of it.
One specific query about adding a filter. In Loren’s excellent blog ‘Own Your WordPress Email with Mandrill’ he gives the example of a filter to change the subject of wp_wp_new_user_notification. Previously I have had a custom function adapting the standard wp_new_user_notification as shown in the WordPress Codex, with a much prettier and more informative version of the email that goes out to a new user. This is now not working and the new user notification reverts to the standard WordPress notifications.
Once I try to adapt using a Mandrill payload filter, building on Loren’s example, the immediate issue is that there are two parts of this function – a message ($message) that goes to the admins to alert them to the new user, and one (also $message) that goes to the new user, with their username, password, plus the text that I have added. Using the payload filter and adding a custom $message[‘subject’] or $message[‘html’] affects BOTH messages, so that they are identical.
I have a function that I wrote to send out mail on publication of a post of a certain category, and that works OK. So in general I think I’ll be fine with functions and filters – it’s this new user notification that I’m scratching my head about.
- The topic ‘Adapting wp_new_user_notification’ is closed to new replies.