Skip to content
Docs
Get RestroPress

Filter

rpress_email_template

Updated
On this page

Filters the slug of the email template in use.

Applied in RPRESS_Emails::get_template() each time the template is requested. The value comes from the email_template setting and defaults to default. The slug selects the header, body and footer template parts and the dynamic rpress_email_template_{$template} action.

Parameters#

ParameterTypeDescription
$templatestringThe email template slug.

Return value#

string. The template slug.

Example#

function my_email_template( $template ) {
	return 'default';
}
add_filter( 'rpress_email_template', 'my_email_template' );

Notes#

The class constructor reads the template once to decide between HTML and plain text mode, so changing the value later to or from none does not switch the mode.

Source#

Applied in:

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

See also#

Was this page helpful?