Skip to content

Instantly share code, notes, and snippets.

@nigelheap
Created July 12, 2017 01:42
Show Gist options
  • Save nigelheap/86af5ccd6833ab6ead6ca312214f20fe to your computer and use it in GitHub Desktop.
Save nigelheap/86af5ccd6833ab6ead6ca312214f20fe to your computer and use it in GitHub Desktop.
<?php
$order = wc_get_order(34152);
$mailer = WC()->mailer();
$mails = $mailer->get_emails();
if ( ! empty( $mails ) ) {
foreach ( $mails as $mail ) {
if ( $mail->id == 'failed_order' ) {
$mail->trigger( $order->id );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment