Created
October 19, 2023 15:42
-
-
Save mujahidi/4de0b119e323b85c7ecc180593b000f0 to your computer and use it in GitHub Desktop.
Create Woocommerce custom email notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mailer = WC()->mailer(); | |
$template = '/emails/customer-admin-order-status.php'; | |
//format the email | |
$subject = 'Order Status Update'; | |
$content = wc_get_template_html( $template, array( | |
'order' => $order, | |
'email_heading' => $subject, | |
'sent_to_admin' => false, | |
'plain_text' => false, | |
'email' => $mailer | |
) ); | |
$headers = "Content-Type: text/html\r\n"; | |
//send the email through wordpress | |
$mailer->send( $recipient, $subject, $content, $headers ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment