Skip to content

Instantly share code, notes, and snippets.

@devinsays
Created October 3, 2017 20:36
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devinsays/fd50d32913e41267a00a8f2a75514849 to your computer and use it in GitHub Desktop.
Save devinsays/fd50d32913e41267a00a8f2a75514849 to your computer and use it in GitHub Desktop.
Sends new WooCommerce customers an account email that with their email address as a login rather than a username.
<?php
/**
* Customer new account email
*
* This template has been overriden to change account creation text.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<p><?php printf( __( 'An account has been created for you on %1$s.', 'woocommerce' ), esc_html( $blogname ) ); ?></p>
<p><?php printf( __( 'You can log in with your email address: %1$s', 'woocommerce' ), '<strong>' . esc_html( $email->user_email ) . '</strong>' ); ?></p>
<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated ) : ?>
<p><?php printf( __( 'Your password has been automatically generated: %s', 'woocommerce' ), '<strong>' . esc_html( $user_pass ) . '</strong>' ); ?></p>
<?php endif; ?>
<p><?php printf( __( 'You can access your account area to view your orders and change your password here: %s.', 'woocommerce' ), make_clickable( esc_url( wc_get_page_permalink( 'myaccount' ) ) ) ); ?></p>
<?php do_action( 'woocommerce_email_footer', $email );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment