Skip to content
Docs
Get RestroPress

Filter

rpress_purchase_subject

Updated
On this page

Filters the subject line of the customer order email.

Runs after the subject is read from the email settings for the order status (or the purchase_subject option for pending orders) and stripped of tags. Email tags in the subject are replaced after this filter runs. The test receipt passes an order ID of 0.

Parameters#

ParameterTypeDescription
$subjectstringSubject with HTML tags stripped. It may still contain email tags such as {order_id}.
$payment_idintID of the order, or 0 for the test receipt.

Return value#

string. The subject line.

Example#

function my_purchase_subject( $subject, $payment_id ) {
	return $subject . ' - ' . get_bloginfo( 'name' );
}
add_filter( 'rpress_purchase_subject', 'my_purchase_subject', 10, 2 );

Notes#

Email tags in the returned string are still replaced afterwards.

Source#

Applied in:

  • includes/emails/functions.php (line 45), in rpress_email_purchase_receipt()
  • includes/emails/functions.php (line 78), in rpress_email_test_purchase_receipt()

See also#

Was this page helpful?