Skip to content
Docs
Get RestroPress

Filter

rpress_email_preview_template_tags

Updated
On this page

Filters the sample email message after the preview template tags have been replaced.

Runs at the end of rpress_email_preview_template_tags, after sample values have been substituted for tags such as {receipt_id}, {sitename} and {payment_id}. It applies to the email preview in the settings and the test email, where no real order exists. Use it to replace additional custom tags with sample content.

Parameters#

ParameterTypeDescription
$messagestringEmail body with the built-in preview tags already replaced.

Return value#

string. The message to use for the preview.

Example#

function my_email_preview_tags( $message ) {
	return str_replace( '{order_note}', __( 'Sample order note', 'my-plugin' ), $message );
}
add_filter( 'rpress_email_preview_template_tags', 'my_email_preview_tags', 10, 1 );

Source#

Applied in:

  • includes/emails/template.php (line 79), in rpress_email_preview_template_tags()

See also#

Was this page helpful?