Skip to content

Instantly share code, notes, and snippets.

@sourovroy
Created July 13, 2021 04:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sourovroy/b31f2accd9bd0998e28dfc2c5ab3c602 to your computer and use it in GitHub Desktop.
Preview WooCommerce Email
<?php
/**
* Plugin Name: Preview Email
* Author: Sourov
*/
function sourov_preview_woo_emails() {
$mailer = WC()->mailer();
$email = $mailer->emails['WC_Email_Customer_Processing_Order'];
$email->object = wc_get_order( 122867 );
echo $email->style_inline( $email->get_content_html() );
exit;
}
add_action( 'wp_ajax_previewemail', 'sourov_preview_woo_emails' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment