rcp_email_templates

The rcp_email_templates filter allows you to register a new email template name. This template will then appear in your templates dropdown (in Restrict > Settings > Emails) and can be selected for use.

A new template can be registered by adding an additional key and value pair to the array:

function ag_rcp_email_templates( $templates ) {
    $templates['my-custom-template'] = __( 'My Custom Template' );

    return $templates;
}

add_filter( 'rcp_email_templates', 'ag_rcp_email_templates' );

The email templates are located in wp-content/plugins/restrict-content-pro/templates/emails/. When you choose a custom template from the list, Restrict Content Pro will attempt to load the following template files:

  • header-{template key}.php
  • body-{template key}.php
  • footer-{template key}.php

So in our above code example, RCP will look for header-my-custom-template.php and so on.

To create your templates, follow our instructions for  editing template files. Your templates should go in your active theme inside a folder called rcp/emails.