Hi life2000
You need to write a filter to hook into the update_welcome_user_email action, like so:
add_filter('update_welcome_user_email', 'filter_newuseremail_dm', 1, 4);
function filter_newuseremail_dm($welcome_email, $user_id, $password, $meta) {
return "body text of your email";
}
If you want to send an email formatted with HTML, you also need to do this:
add_filter('wp_mail_content_type', 'newuseremail_content_type_dm', 1);
function newuseremail_content_type_dm() {
return 'text/html';
}
Sorry, forgot to add. Use these tokens in your update_welcome_user_email function to tell WordPress where to insert the relevant values: USERNAME PASSWORD LOGINLINK SITE_NAME
Hi DJPaul:
Thank you for your reply.
How do I get to “update_welcome_user_email” at the outset? Or better said, where do I begin to start these changes and filters. BP Core files? WPMU files?
Sorry, still trying to get the hang of it all:)
Thanks so much;
vida
There has to be an MU plugin already put together for this somewhere no? I am looking now…
life2000: Make a new file in your wp-content/mu-plugins/ folder. Call it what you want but make the extension .php.
Put this tag at the top of the file: <?php
Copy and paste the code from above underneath it
And at the bottom of the file, put this: ?>
Save it and it should work immediately. Make a new test user to see if the message changes.
Hi DJPaul:
So, I created the little plugin and placed it in wp-content/mu-plugin folder.
I then went back to the “welcome” box to make the changes to the outgoing text. No changes were made. Sorry for being slow here. But these are the questions I have right now!
1) I have no idea what to do with this step you mentioned above:
“Sorry, forgot to add. Use these tokens in your update_welcome_user_email function to tell WordPress where to insert the relevant values: USERNAME PASSWORD LOGINLINK SITE_NAME”
2) After I create the file and place it in the Mu plugin, where should I go to customize my final message going to the user.
I really appreciate the help.
Thanks so much;
Vida
Vida
Email me at djpaul at gmail dot com. I’ve spent sometime shoehorning this into a “proper” plugin – it’s not complete but would appreciate it if you could test with what I’ve got so far.
DJPaul, I just saw your comments about this on mu trac. Nice find!
I couldn’t find any existing plugin…obviously;)
DJPaul, is it cool if I test your plugin?
DJPaul sign me up for testing too!
KevinRyman: please email me. I’m only asking because I haven’t got anywhere ready to upload a file yet. Thanks.
FYI https://trac.mu.wordpress.org/ticket/894#comment:3 has added a hook so we can customise the subject line of the email sent to new users (accounts) after activation.
Thank you DJPaul;
Then at this point what steps should we take to change the message? I assume we don’t need a plugin, but just changing the text somewhere in MU files, right? But where?
I would appreciate your response.
Thanks so much;
vida
The only thing you can’t change safely is some of the subject lines of the emails. If that’s not 100% essential to the launch of your site, I would suggest waiting for the next release of WPMU – or just running a copy from trunk.
However if you follow the link above you should be able to find out what file you need to change.