rcp_email_templates

Note: This is part of the developer docs and is considered custom code.
Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code.

If you need assistance with this, please reach out to our list of consultants for further assistance:
https://codeable.io/developers/restrict-content-pro/

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.

Have more questions? Submit a request