Skip to content

Instantly share code, notes, and snippets.

@jancbeck
Created April 8, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jancbeck/73fb5ed3edc5ba43cf2d2fa6f030c798 to your computer and use it in GitHub Desktop.
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
<?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