Create user using the API doesn’t send choose password email
-
Hi,
When I use this endpoint API, I can successfully create a new user with
curl
but it doesn’t send a link, to the new user’s email, to choose a password. It simply sends a welcome email with a domain link.When I dig into the settings on how this email is generated, at my domain’s
/wp-admin/admin.php?page=wc-settings&tab=email§ion=wc_email_customer_new_account
,
I find the following an interesting clue<?php if ( 'yes' === get_option( 'woocommerce_registration_generate_password' ) && $password_generated ) : ?> <?php /* translators: %s: Auto generated password */ ?> <p><?php printf( esc_html__( 'Your password has been automatically generated: %s', 'woocommerce' ), '<strong>' . esc_html( $user_pass ) . '</strong>' ); ?></p> <?php endif; ?>
But I’m not able to trigger the auto-generate password. If I try to modify
woocommerce_registration_generate_password
option toyes
using/wp-admin/options.php
, saving just reverts back tono
. But, I’m not 100% sure if this is relevant because if I manually create a user, an email is sent with a “click here to set your password”.
Trying to add additional payloads to affect email generation failed
curl --request POST -H "woocommerce_registration_generate_password: yes" -H "x-woocommerce_registration_generate_password: yes" "https://domain.tld//wp-json/wc/v3/customers?params=" -d '{"meta_data": [{"woocommerce_registration_generate_password": "yes"}], "woocommerce_meta": {"woocommerce_registration_generate_password": "yes"}}'
What is the correct way to create a user, that’ll send a “please choose a password” email, using
curl
?- This topic was modified 3 years ago by .
- This topic was modified 3 years ago by .
- This topic was modified 3 years ago by .
The page I need help with: [log in to see the link]
- The topic ‘Create user using the API doesn’t send choose password email’ is closed to new replies.