Created
January 30, 2018 17:57
-
-
Save jimfloss/0fc134d5fb948587edfdf222283a15d3 to your computer and use it in GitHub Desktop.
Programmatically send a New User WooCommerce email
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
<?php | |
$woocommerce_customer_new_account_settings = get_option('woocommerce_customer_new_account_settings'); | |
$user_pass = 'generated_password'; | |
$user_login = 'user_name'; | |
$email = '[email protected]'; | |
$blogname = 'user_name'; | |
$password_generated = 'generated_password'; | |
require_once( '/www/wp-content/themes/theme-name/woocommerce/emails/customer-new-account.php' ); | |
$email_content = ob_get_clean(); | |
$mailer = WC()->mailer(); | |
$mailer->send( $email, $woocommerce_customer_new_account_settings["subject"], $mailer->wrap_message( $woocommerce_customer_new_account_settings["subject"], $email_content ), '', '' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment