I’m trying to create a customer with email and password using the customerCreate mutation on the GraphQL storefront API.
From what I understand this method should bypass the Account Activation process and just create the customer account, however it is always triggering the activation process along with the message API response message “We have sent an email to xxx@xxxxx.com, please click the link included to verify your email address.”
Is there something i’m missing? According to the docs it should create the account and send the customer an email telling them their account is already activated. Why require a Password in the query if they have to activate their account and choose a password again afterwards?
I know, the customer create process is a little bit confusing and some of the wording on the documentation could be made more clear
From what I know and as it says here, The customerCreate mutation actually triggers an account activation email. It doesn’t automatically activate the account and if you think about it, it makes a lot of sense. Imagine you had a typo on the email address!
As far I know, there is no other way to go about it other than updating the activation email template. It still require they open the activation email but at least you can have a bit of control. For example, instead of going through to shopify for activation, you can make them come to your app’s website and you can activate on their behalf.
Hope this helps to clarify things a little!
Thanks for the info. The docs clearly state that if you use the customerCreate mutation on the storefront API that it will send the customer an email notifying them that their account has been activated.
Also, why do they require a password be sent with the mutation query if the activation process is going to ask them to set another password?
Sure, I know. That’s why I said the wording can be a little confusing. That mutation requires email and password by default - which for me is logical.
What’s crazy is why they require password reset on activation. That part I don’t understand because I don;'t have business decision document!
Also, if you look at the notification templates - there are two associated with customer account creation. These are Customer account invite and Customer account welcome. The welcome notification email is automatically triggered after an activation event.
The invite is automatically triggered after a creation event. At no point during the customerCreate mutation - activation happens. It has to be invoked. So for me that line on documentation is missleading.
Instead of account has been activated it should instead say account has been created.
Ok thanks for the information.
I discovered an interesting edge case with this API. If the email address that I am trying to create an account with has an existing order, then the API generates the activation email and doesn’t automatically activate the account. If the email address doesn’t have an existing order associated with it then the API creates the account and automatically activates it, no activation email is sent.
This is clearly broken and doesn’t make any sense.
That’s strange. So in the.. If the email address doesn’t have an existing order scenario, does it send a welcome email instead or nothing at all?
I will give it a try tomorrow but for sure that logic is odd.
Based on my recent tests if the email address doesn’t have an existing order scenario it doesn’t send any emails. It just creates the account with the provided password and activates it automatically.