send_email_welcome not working as expected when creating customer objects

Lachlan_Laycock
Shopify Partner
12 0 2

Hello,

I am using the API to create Customer objects as part of a mass migration. I would like my new customer objects to have an account associated with them so I add a password, password_confirmation and send_email_welcome field (see example below). The customer accounts are created as expected and their ‘state’ is also ‘enabled’ as expected. However an Account Confirmation notification email is sent to the user despite having set the send_email_welcome field to false.

Unless I have misunderstood the intended behaviour of this field it would appear to be a bug? Could someone please shed some light on this? Is it a bug or have I misunderstood?

{
	“customer”: {
		“id”: 123,
		…
		“state”: “enabled”,
		“password”: “abc”,
		“password_confirmation”: “abc”,
		“send_email_welcome”: false
	}
}

 

Regards,

Ginko
Shopify Partner
19 0 10

Hello,

 

Im having the same issue. Customers created via api with 

 

send_email_welcome”: false

but the account confirmation email is still sending. 

0 Likes
_JB
Shopify Staff
Shopify Staff
834 99 189

Hey @Lachlan_Laycock and @Ginko,

 

Thanks for bringing this up, I've tested on my end and have been able to replicate the behaviour. The issue has been raised with our developers who will be investigating further, I'll post back here when I have an update on the issue.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Ginko
Shopify Partner
19 0 10

Thanks @_JB !

 

I was not expecting a response from a 2015 forum post. Really appreciate it!

0 Likes
Ginko
Shopify Partner
19 0 10

Hey,

Any update on this? The error still seems to be present.

Best,

Sebastian

0 Likes
_JB
Shopify Staff
Shopify Staff
834 99 189

Hey @Ginko,

I don't have an update right now, but I just tried the call again from my end and I'm no longer able to replicate. Can you confirm the e-mail you're seeing is the "Account Welcome" e-mail, and not the "Account Invite" one? I think I mixed these up myself when I tested before.

For clarity, the invite e-mail is expected when you create a new customer without specifying a password for their account, so they're invited to create their own password which activates the account. The welcome e-mail is expected when you provide a password in your API call, so the account is activated automatically with that password.

If you're sure the welcome e-mail is being sent despite sending send_email_welcome: false, please provide the X-Request-ID from your call and we'll use that to investigate further.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Ginko
Shopify Partner
19 0 10

Hi @_JB 

Thank you for the response. We did some more research and found the root cause of the confusion. From your reply, we conclude that the send_email_welcome property only applies when specifying a password in the API call, which we are not doing. When a password is instead entered manually by the customer (in our case "affiliate") during the activation process, the welcome email always gets sent, regardless of the property:

 

"requesting https://sa-dev-1.myshopify.com/admin/api/2021-01/customers.json
{""customer"":{""first_name"":""A"",""last_name"":""B"",""email"":""alexei+202101-1@simple-affiliate.com"",""accepts_marketing"":true,""accepts_marketing_updated_at"":""2021-01-21T19:57:11.718Z"",""marketing_opt_in_level"":""confirmed_opt_in"",""send_email_invite"":false,""send_email_welcome"":false}}
headers.date Thu, 21 Jan 2021 19:57:12 GMT
headers.x-shopify-api-version 2021-01
headers.x-request-id 964692e7-15eb-42db-a23a-0c831d176d03
https://sa-dev-1.myshopify.com/account/activate/4601431654577/b6917d407b2451413dd2dcee0e842ff4-1611259038"

 

We did test Shopify behavior when specifying a password in the API and were not able to receive a welcome email regardless of the provided send_email_welcome value. Based on that test it seems that this property doesn't even work in the intended context. Note also that it is not well documented on Shopify side either: https://shopify.dev/docs/admin-api/rest/reference/customers/customer (ctrl-f "send_email_welcome"):

 

"requesting https://sa-dev-1.myshopify.com/admin/api/2021-01/customers.json
{""customer"":{""first_name"":""A"",""last_name"":""B"",""email"":""alexei+202101-2@simple-affiliate.com"",""accepts_marketing"":true,""accepts_marketing_updated_at"":""2021-01-21T20:04:13.544Z"",""marketing_opt_in_level"":""confirmed_opt_in"",""send_email_invite"":false,""send_email_welcome"":true,""password"":""qweqwe"",""password_confirmation"":""qweqwe""}}
headers.date Thu, 21 Jan 2021 20:04:15 GMT
headers.x-shopify-api-version 2021-01
headers.x-request-id 27a46398-5daa-4607-a339-95383940da42"

 

For this task, seems that our only option is to ask to implement new functionality: the ability to disable welcome email regardless of whether password is specified in the create customer API call.

0 Likes