Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ben Ritner – Kadence WP

    (@britner)

    Hey,
    I think I would approach this from a different angle, rather than trying to change the WordPress user registration to use woocommerce, I would suggest just not using the default WordPress user registration form and force everyone to register through woocommerce on your site. Could that work for you?

    Ben

    Thread Starter resepu

    (@resepu)

    Hi @britner,

    I understand you very well, this was something that I tried first.
    But actually the situation is that I use Byanca theme and there is a plugin called Byanca Membership. This is a nice plugin but what it does is registering people as wordpress users instead of woocommerce customers. I tried to contact with them but they could not offer me a fix. They just said that this is what we have and you should use this.

    So I have no option but changing and beautifying wordpress default email template. ??

    hannah

    (@hannahritner)

    Hey @resepu,
    Sorry for the delay! I’m not familiar with Byanca theme, but it seems like WooCommerce should be able to override this? Ben may have more insight, but he and his wife had a baby over the weekend so he has been a bit tied up. But I will make sure he sees this and responds when he gets a chance.
    Thanks for your patience!

    Hannah

    Plugin Author Ben Ritner – Kadence WP

    (@britner)

    Hey, So you would need to approach through custom functions then and use what is outlined in the link above that you provided to override the default WordPress function and send the email through woocommerce.

    The exact code would be tricky, my guess without much research would be to load woocommerce emails:

    $wc_emails = WC_Emails::instance();

    Then get emails:

    $emails = $wc_emails->get_emails();

    Then pull in the email type:

    if ( isset( $emails[ 'WC_Email_Customer_New_Account' ] ) && is_object( $emails[ 'WC_Email_Customer_New_Account' ] ) ) {
      $email = $emails[ 'WC_Email_Customer_New_Account' ];
    };

    get the user:

    $user = new WP_User($user_id);

    Set up the email:

    $email->object             = $user;
    $email->user_pass          = '{user_pass}';
    $email->user_login         = stripslashes( $email->object->user_login );
    $email->user_email         = stripslashes( $email->object->user_email );
    $email->recipient          = $email->user_email;
    $email->password_generated = TRUE;

    and send:

    if ( $email->get_recipient() ) {
    $email->send( $email->get_recipient(), $email->get_subject(), $email->get_content(), $email->get_headers(), $email->get_attachments() );
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress User Registration Email’ is closed to new replies.