Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using WooCommerce email design in custom emails
$email = 'ashfame@example.com';
$subject = 'Custom stuff email';
$email_heading = 'Custom Heading';
$email_content = ''; // whatever it is
ob_start();
do_action( 'woocommerce_email_header', $email_heading );
echo $email_content; // or simply have HTML markup outside PHP tags here
$email_content = ob_get_clean();
wp_mail( $email, $subject, $email_content );
$email = 'ashfame@example.com';
$subject = 'Custom stuff email';
$email_content = ''; // whatever it is
wp_mail( $email, $subject, $email_content );
@Krapulat

This comment has been minimized.

Copy link

commented Jul 25, 2016

This doesn't work in new WP versions. Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.