1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Registration
  5. Filter approval and rejection messages
  1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Filter approval and rejection messages

Filter approval and rejection messages

You can filter the email messages sent when a user is approved or rejected using the following snippet:

<?php
/**
* Filter the content of the user approval message
* @param $message The message content
* @param $url The url to redirect the user to
* @param $user The user object
*/
function prefix_user_approval_message( $message, $url, $user ) {
$message = 'My new message goes here';
return $message;
}
add_filter( 'wcmo_user_approval_message', 'prefix_user_approval_message', 10, 3 );
/**
* Filter the content of the user rejection message
* @param $message The message content
* @param $url The url to redirect the user to
* @param $user The user object
*/
function prefix_user_rejection_message( $message, $url, $user ) {
$message = 'My new message goes here';
return $message;
}
add_filter( 'wcmo_user_rejection_message', 'prefix_user_rejection_message', 10, 3 );
/**
* Filter the subject
* @param $subject The subject
*/
function prefix_user_approval_rejection_subject( $subject ) {
$subject = 'My new subject goes here';
return $subject;
}
add_filter( 'wcmo_user_approval_rejection_subject', 'prefix_user_approval_rejection_subject' );

Here’s how to add a snippet.

Was this article helpful?

Related Articles