1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Registration
  5. Filter new user registration email content
  1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Filter new user registration email content

Filter new user registration email content

Use this wcmo_new_registration_email_content to filter the content of the email sent to the site admin when a user needs to be approved.

<?php
/**
* Filter the content of the new user registration email
* @param $message The email content
* @param $user The user object
* @param $blogname The name of the site
* @param $url The url for the user profile
*/
function prefix_new_registration_email_content( $message, $user, $blogname, $url ) {
$message = sprintf(
'<p>%s</p>',
'My new message goes here'
);
// Use the parameters to include extra information
$message = sprintf(
'<p>%s: <a href="%s">%s</a></p>',
'Follow the link to review the user',
$url,
'Click here'
);
return $message;
}
add_filter( 'wcmo_new_registration_email_content', 'prefix_new_registration_email_content', 10, 4 );

Here’s how to add a snippet.

Was this article helpful?

Related Articles