Skip to content

Instantly share code, notes, and snippets.

@ashfame
Created March 17, 2014 22:38
Show Gist options
  • Select an option

  • Save ashfame/9609823 to your computer and use it in GitHub Desktop.

Select an option

Save ashfame/9609823 to your computer and use it in GitHub Desktop.
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

Copy link
Copy Markdown

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