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:
- {display_name}
- {first_name}
- {last_name}
- {username}
- {gender}
- {email}
- {submitted_registration}
- {admin_email}
- {site_name}
- {site_url}
- {account_activation_link}
- {user_account_link}
- {user_profile_link}
- {login_url}
- {password}
- {usermeta:here_any_usermeta_key}
Example: {usermeta:store_location}
where store_location
is meta key.
Template-specific placeholders:
- {login_referrer}
- {password_reset_link}
- {user_avatar_url}
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]