Skip to content

Instantly share code, notes, and snippets.

@growdev
Created March 25, 2016 20:00
Show Gist options
  • Save growdev/d8e9ddea3940b0d7e1a7 to your computer and use it in GitHub Desktop.
Save growdev/d8e9ddea3940b0d7e1a7 to your computer and use it in GitHub Desktop.
Trigger WooCommerce email from WP-CLI
<?php
/**
* This can be run by wp-cli to trigger an email send.
* The email is determined by the action. The one below will trigger the "new order email"
*/
WC()->mailer();
$order_id = '260'; // this order needs to exist in your store
$args = array( 'order_id' => $order_id );
do_action_ref_array( 'woocommerce_order_status_pending_to_processing_notification', $args );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment