Creating custom email tags

The wpum_add_email_tag() function allows you to create custom email tags for all the email notifications sent through WPUM.

The wpum_add_email_tag() function takes three parameters:

  1. $tag – The name of the tag to create, example: “admin_email”. In the email content, tags are wrapped with {} but not when they are registered.
  2. $description – The description of what the tag displays.
  3. $func – The name of the call back function that renders the tag’s output.

Here's an example that displays the site's email address:

This same method can be used to display any user custom field.

In the above example, you will be using the WP function get_user_meta https://codex.wordpress.org/Function_Reference/get_user_meta to retrieve the value of a custom field. If you need to retrieve a custom fields created through the custom fields addon, please read here how to get the user field key http://docs.wpusermanager.com/article/381-what-is-the-field-meta-key-option

Note custom fields created with the addon cannot be displayed right now, the above example will work after WP User Manager v.1.3 is released.