Created
December 10, 2025 16:07
-
-
Save gaelgerard/5204e8e4ee3db856664009e8442dc4c7 to your computer and use it in GitHub Desktop.
WordPress Send email using the WooCommerce template.
This file contains hidden or 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
| /** | |
| * Send email using the WooCommerce template. | |
| * | |
| * @param string $to Receiver's email. | |
| * @param string $email_subject Email subject. | |
| * @param string $body_heading Title which appears at the top in large fonts. | |
| * @param string $body_message Email text. | |
| * | |
| * @return bool | |
| */ | |
| function wc_send_email( $to, $email_subject, $body_heading, $body_message ) { | |
| $mailer = WC()->mailer(); | |
| $message = $mailer->wrap_message( $body_heading, $body_message ); | |
| return $mailer->send( $to, wp_strip_all_tags( $email_subject ), $message ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment