Created
May 27, 2024 12:14
-
-
Save webtoffee-git/843bd1596c5d5536e5c27d577d038381 to your computer and use it in GitHub Desktop.
Add custom shortcodes to Wordpress emails - By WebToffee( Decorator – WooCommerce email customizer )
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 //Do not copy this line of code | |
add_filter('wt_woomail_no_order_body_text','wbtf_add_custom_placeholder_to_user_emails',10,2); | |
function wbtf_add_custom_placeholder_to_user_emails($body_text, $email) { | |
if ( is_a( $email->object, 'WP_User' ) ) { | |
$body_text = str_replace( '{custom_value}', 'Actual data to replace', $body_text ); // Replace placeholder and value here | |
} | |
return $body_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment