I have a woocommerce plugin and it provides an API url ?wc-api=myplugin
.
The plugin adds a new email also.
function add_newstatus_woocommerce_email( $email_classes ) {
require( 'emails/class-newstatus-email.php' );
$email_classes['WC_Simplepay_Success_Email'] = new WC_Simplepay_Success_Email();
return $email_classes;
}
add_filter( 'woocommerce_email_classes', 'add_newstatus_woocommerce_email' );
In emails/class-wc-simplepay-success-email.php
I add an action in the constructor.
add_action( 'woocommerce_order_status_newstatus', array( $this, 'trigger' ) );
How can I use do_action
to run this action from the plugin file? This does not seems to work. I guess it does not see that action.
do_action('woocommerce_order_status_newstatus');
emails/class-wc-simplepay-success-email.php
definitely being included, and included in time before the action hook fires?