Created
April 8, 2017 08:36
-
-
Save jancbeck/73fb5ed3edc5ba43cf2d2fa6f030c798 to your computer and use it in GitHub Desktop.
Uses the "New Customer" email template by WooCommerce when a new user is created via the WP Job Manager. Add to your themes functions.php
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 | |
function wp_job_manager_notify_new_user( $user_id, $password ){ | |
global $wp_version; | |
$wc_emails = WC_Emails::instance(); | |
if ( empty($wc_emails)) { | |
return; | |
} | |
if ( version_compare( $wp_version, '4.3.1', '<' ) ) { | |
$wc_emails->customer_new_account( $user_id, array( 'user_pass' => $password ), $password_generated = true ); | |
} else { | |
$wc_emails->customer_new_account( $user_id ); | |
wp_new_user_notification( $user_id, null, 'admin' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment