Filter
rpress_purchase_receipt_{$template}
On this page
Filters the customer receipt body for the active email template.
Runs in rpress_get_email_body_content after the body for the order status is loaded and optionally passed through wpautop. The hook name ends with the active template slug returned by RPRESS()->emails->get_template(): by default rpress_purchase_receipt_default or rpress_purchase_receipt_none. The generic rpress_purchase_receipt filter runs on the result afterwards.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$email_body | string | Receipt body before email tags are replaced. |
$payment_id | int | ID of the order. |
$payment_data | array | Order meta from _rpress_payment_meta. |
Return value#
string. The receipt body.
Example#
function my_default_template_receipt( $email_body, $payment_id, $payment_data ) {
return $email_body . '<p>' . esc_html__( 'Allergy questions? Call us.', 'my-plugin' ) . '</p>';
}
add_filter( 'rpress_purchase_receipt_default', 'my_default_template_receipt', 10, 3 );
Notes#
Only the 'default' and 'none' template slugs ship with RestroPress; additional slugs can be registered through the rpress_email_templates filter.
Source#
Applied in:
includes/emails/template.php(line 212), inrpress_get_email_body_content()
See also#
Was this page helpful?
