Filter
rpress_admin_order_notification_attachments
On this page
Filters the file attachments sent with the admin order notification.
Runs in rpress_admin_email_notice before the admin email is sent. The default is an empty array. Return absolute file paths to attach to the notification.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$attachments | array | List of file paths to attach. Empty by default. |
$payment_id | int | ID of the order. |
$payment_data | array | Order meta passed to the admin notice. |
Return value#
array. The list of attachment file paths.
Example#
function my_admin_notification_attachments( $attachments, $payment_id, $payment_data ) {
$file = WP_CONTENT_DIR . '/uploads/tickets/order-' . absint( $payment_id ) . '.pdf';
if ( file_exists( $file ) ) {
$attachments[] = $file;
}
return $attachments;
}
add_filter( 'rpress_admin_order_notification_attachments', 'my_admin_notification_attachments', 10, 3 );
Source#
Applied in:
includes/emails/functions.php(line 134), inrpress_admin_email_notice()
See also#
Was this page helpful?
