• Resolved luizgustavs

    (@luizgustavs)


    Hi, i would like to trigger the WC’s new account email when an new account is added to my WP database (this mean when someone create an account by using any means, any form), for this project i cannot use the wc registration form, i tried to make “costumer” the default role on my WP to trigger the email but didn’t work

    – Yes, emails are working fine, every email works except the new account’s email
    – Yes, the new account email is enable on WC config
    – Yes, need to be the WC new account email
    – The mail logging does not show any email being generated on account creation

    Could someone help me? I just need to trigger the WC new account email when someone register

Viewing 4 replies - 1 through 4 (of 4 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @luizgustavs,

    By default “New account” email notifications are sent to the customer upon successful registration. It sounds like you’re not using the default WooCommerce registration form so that may be the reason why it’s not properly working.

    I would suggest that you disable all other plugins (except WooCommerce), deactivate custom snippets, and change the theme to Storefront. With this setup check again if the registration process works correctly. If it does, you may want to narrow it down to the tool that is causing the behavior by conflict testing.

    Just to mention, that we also have support documentation for issues related to email sending here: https://woocommerce.com/document/email-faq/.

    Thanks.

    Thread Starter luizgustavs

    (@luizgustavs)

    Well, as i said, use the wc registration form is not an option because there is another plugin handling the user registration, i just would like to trigger WC’s new account email even when the account is being made by the default wordpress system or by another plugin.

    The good news is that i got a solution, i will leave here.

    if someone one day needs a solution like that, this simple code worked for me:

    function send_welcome_email_to_new_user($user_id) {
    	$wc = new WC_Emails();
    	$wc->customer_new_account($user_id);
      }
    add_action('user_register', 'send_welcome_email_to_new_user');

    if there is any suggestion ou someone wants to improve this little code, would be nice!

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    I understand that you are using another plugin to manage customer registrations, in which case we would not be able to provide support for third-party plugins using which the email sending function does not work properly.

    On this specific forum, we only provide support for the default functions and functionalities of WooCommerce core.

    Great to hear that you got a solution using a custom snippet and thanks so much for sharing it with everyone reading the thread. It’ll be helpful for others facing a similar issue!

    If you have any further questions, I recommend creating a new thread.

    Have a great day!

    Thread Starter luizgustavs

    (@luizgustavs)

    i understand you point, but for my perspective i was asking support for WC, i asked to trigger a WC core function by using a code snippet in a certain condition, is not about any other plugin, only trigger a WC funcion.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘trigger new account email’ is closed to new replies.