Skip to content
Docs
Get RestroPress

Filter

rpress_email_templates

Updated
On this page

Filters the list of available email templates.

Applied at the end of RPRESS_Emails::get_templates(). The default array has the default template and the none template, which sends plain text without HTML wrapping. The list is also returned by rpress_get_email_templates(). A custom template also needs the template parts or an rpress_email_template_{$template} action to render.

Parameters#

ParameterTypeDescription
$templatesarrayAssociative array of template slug => label.

Return value#

array. The available templates.

Example#

function my_email_templates( $templates ) {
	$templates['compact'] = __( 'Compact Template', 'my-plugin' );
	return $templates;
}
add_filter( 'rpress_email_templates', 'my_email_templates' );

Source#

Applied in:

  • includes/emails/class-rpress-emails.php (line 208), in RPRESS_Emails::get_templates()

See also#

Was this page helpful?