uo_verified_email_subject
Filters user verification subject. Filters the subject line of the user verification email before it is sent to the user.
add_filter( 'uo_verified_email_subject', $callback, 10, 1 );
Description
Allows developers to customize the subject line of the email sent to a user upon account verification. Modify the default subject to include custom text, user-specific details, or brand elements. This hook fires after the user object is ready for email processing.
Usage
add_filter( 'uo_verified_email_subject', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
<?php
/**
* Customize the subject of the user verification email.
*
* This example appends the site name to the default subject for a more personalized touch.
*
* @param string $subject The current email subject.
* @param WP_User $user The user object for the verified user.
* @return string The modified email subject.
*/
add_filter( 'uo_verified_email_subject', function( $subject, $user ) {
// Get the site name
$site_name = get_bloginfo( 'name' );
// Append the site name to the subject
return sprintf( '%s - %s', $subject, $site_name );
}, 10, 2 );
?>
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/classes/frontend-login-plus.php:1498
src/classes/frontend-login-plus.php:1557
/**
* Filters user verification subject.
*
* @param string $subject The email subject.
* @param WP_User $user The verified user.
*/
$subject = apply_filters( 'uo_verified_email_subject', $subject, $user );
// Create verified user body
$default_body = __( 'Your account has been approved! ', 'uncanny-learndash-toolkit' ) . "rnn";
$default_body .= sprintf( __( 'Please visit %s to login. ', 'uncanny-learndash-toolkit' ), home_url() ) . " rn";
/**
* Filters user verification email message.
*