Action
rpress_add_email_tags
Fires on init to let code register custom email template tags.
Runs from rpress_load_email_tags() on init at priority -999. The core tags are added by a callback on this action, so register extra tags here with rpress_add_email_tag( $tag, $description, $func ). The callback receives the order ID and the tag name and must return the replacement string.
Example#
function my_register_email_tags() {
rpress_add_email_tag( 'my_order_ref', 'A custom order reference', 'my_order_ref_tag' );
}
function my_order_ref_tag( $payment_id ) {
return 'REF-' . rpress_get_payment_number( $payment_id );
}
add_action( 'rpress_add_email_tags', 'my_register_email_tags' );
Notes#
Because it fires on init at priority -999, add your callback to this action before then, for example from plugins_loaded.
Source#
Fired from:
includes/emails/email-tags.php(line 106), inrpress_load_email_tags()
See also#
Was this page helpful?
