woocommerce_rest_order_actions_email_send
Action to trigger sending a custom order email template from a REST API request.
The email template must first be made available for the associated order. See the woocommerce_rest_order_actions_email_valid_template_classes hook.
Usage
add_action( 'woocommerce_rest_order_actions_email_send', 'wp_kama_woocommerce_rest_order_actions_email_send_action', 10, 2 ); /** * Function for `woocommerce_rest_order_actions_email_send` action-hook. * * @param int $order_id The ID of the order. * @param string $template_id The ID of the template specified in the API request. * * @return void */ function wp_kama_woocommerce_rest_order_actions_email_send_action( $order_id, $template_id ){ // action... }
- $order_id(int)
- The ID of the order.
- $template_id(string)
- The ID of the template specified in the API request.
Changelog
Since 9.8.0 | Introduced. |
Where the hook is called
woocommerce_rest_order_actions_email_send
woocommerce/src/Internal/Orders/OrderActionsRestController.php 497
do_action( 'woocommerce_rest_order_actions_email_send', $order->get_id(), $template_id );