How to add and use custom email templates

How to add custom email template

Use the um_email_notifications hook to add custom templates. See code examples below.

Use the UM()->mail()->send( $email, $template, $args ); method to send email based on template. Optional argument $args allow to extend placeholders array.

You can add your custom code to the functions.php file in your active theme directory. Using a child theme is recommended.

How to edit custom email template

Custom emails are shown on wp-admin > Ultimate Member > Settings > Email. Administrator can edit custom email templates in the same way as default email templates.

Image - Email templates on wp-admin > Ultimate Member > Settings > Email

Image - Email template settings on wp-admin > Ultimate Member > Settings > Email > Edit

Code examples

Example 1 - Profile is complete

This code adds the custom email template "Profile Completeness - Profile is complete" to be used in the Profile Completeness extension.

NOTE: We are not able to provide any support when it comes to customizing the plugin. We created this code example to provide guidance only.

Example 2 - Account is not verified

This code adds the custom email template "Verified Users - Account is not verified E-mail" to be used in the Verified Users extension.

NOTE: We are not able to provide any support when it comes to customizing the plugin. We created this code example to provide guidance only.

Warning: We highly recommend to use child-theme for public free or pro themes. Do not edit template files within the core plugin itself, as they are overwritten during the upgrade process and any customizations will be lost. We recommend using a child-theme, which has no dependencies with the official themes repo, so your custom files cannot be rewritten after a theme upgrade.