Created
May 25, 2022 13:34
-
-
Save runezero/8ff485e5b7f4adea737d63d7ce1b0114 to your computer and use it in GitHub Desktop.
[Gravity mails with Woo Styling] Set the header, footer and body styling within Gravity Mails to WooCommerce Mails #woocommerce #gravityforms
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
| add_filter( 'gform_html_message_template_pre_send_email', 'maybe_enable_wc_template_for_gf_notifications'); | |
| function maybe_enable_wc_template_for_gf_notifications($template){ | |
| if(class_exists('woocommerce')) { | |
| ob_start(); | |
| wc_get_template( 'emails/email-header.php', array( 'email_heading' => '{subject}' ) ); | |
| echo '<style>'; | |
| wc_get_template( 'emails/email-styles.php'); | |
| echo '</style>'; | |
| echo '{message}'; | |
| wc_get_template( 'emails/email-footer.php' ); | |
| $template = ob_get_contents(); | |
| ob_end_clean(); | |
| return $template; | |
| } | |
| return $template; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment