Placeholders for email templates

This documentation provides a list of available placeholders you can use in the email templates. You also can use these placeholders in settings "User Profile Title" and "User Profile Dynamic Meta Description".

Common placeholders:

Placeholders Descriptions
{display_name} Displays the name of the user.
{first_name} Displays the first name of the user.
{last_name} Displays the last name of the user.
{username} Displays the username of the user.
{gender} Displays the gender of the user.
{email} Displays the email of the user.
{submitted_registration} Displays the details of the registration form the user has submitted.
{admin_email} Displays the admin's email.
{site_name} Displays the website name.
{site_url} Displays the website's URL.
{account_activation_link} This generates the account activation link when clicked user's account will be activated
{user_account_link} This generates the user's account link, when clicked the user will be redirected to his account
{user_profile_link} This generates the user's profile link, when clicked the user will be redirected to his profile.
{login_url} This generates the login URL of your site when clicked the user will be redirected to his account
{password} Displays the text  Your set password
{action_url} This generates a set password link when there are no password fields in the registration form. When clicked, it shows the Set Password form.
{action_title} This displays the text Set your Password when the password field is not present in a registration form. However, if the password field exists in the form, it will display Login to your site.
{usermeta:here_any_usermeta_key} Displays any value from the user meta.
Example:  {usermeta:store_location} where store_location is meta key.

Template-specific placeholders:

Placeholders Description
{login_referrer}
{password_reset_link} This generates the link for the password reset page, when clicked, users will be redirected to the password reset page.
{user_avatar_url} Displays the Profile Photo URL of the registered user.

It is possible to create custom placeholders

Use this pair of hooks to add placeholders and their values:

  • um_template_tags_patterns_hook
  • um_template_tags_replaces_hook
Example:
/**
 * Add short tag {user_id}
 */
add_filter( 'um_template_tags_patterns_hook', 'my_template_tags_patterns', 10, 1 );
add_filter( 'um_template_tags_replaces_hook', 'my_template_tags_replaces', 10, 1 );

function my_template_tags_patterns( $search ) {
	$search[] = '{user_id}';
	return $search;
}
function my_template_tags_replaces( $replace ) {
	$replace[] = um_user( 'ID' );
	return $replace;
}

It is possible to use placeholders in the shortcode [um_show_content]. This shortcode used to display role-specific content in pages and posts. This shortcode converts common placeholders to proper values.

Example:

[um_show_content roles="contributor,subscriber"] {display_name} [/um_show_content]