Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Trigger double opt-in notification for customer created via API

Trigger double opt-in notification for customer created via API

MarcBaumbach
Shopify Partner
32 0 15

I'm wondering if there's a way to trigger the double opt-in email notification when creating a customer via the REST (or GraphQL) API. If you have that setting on, it doesn't appear to send a double opt-in regardless of the "email_marketing_consent" state or opt-in level.

 

Does the double opt-in only work when subscribing using the storefront APIs?

Replies 11 (11)

Alan
Shopify Staff
129 15 25

Hey @MarcBaumbach - thanks for reaching out and for this great question. 

 

I was able to get in touch with our developers on this  - specifically about how customer creation through the Admin API works and how it further  relates to marketing consent/double opt-in on the customer level. At the moment, it is expected behaviour of the Admin API that the double opt-in email won't trigger when a customer is created through the Admin API, even if the the marketing consent fields are properly populated. You are correct though, that the only way to trigger the opt-in emails through our APIs is by making a createCustomer mutation request through our Storefront API.

 

That said, I'm going to pass along some feedback to our developers directly so that we can take a look at adding this type of functionality to the Admin API, as I definitely understand how it would be useful within the wider context of an app that already uses the Admin API as part of its workflow. I can't guarantee what the response will be here or what the timeline would be - but I'm happy to advocate for this on my end - can definitely see where there would be a use case for this functionality in the Admin API 

 

I'm also going to get in touch with the team that handles our developer documentation to see if they can provide more clarity when it comes to expected behaviour for email consent/double opt-in functionality for our APIs.

 

Let me know if I can clarify anything on our end here - cheers! 

Alan | API 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

MarcBaumbach
Shopify Partner
32 0 15

Thanks @Alan! I appreciate you vouching for us. As an email service provider (Seguno) that is dedicated to working closely with Shopify's data and treating Shopify as the system of record we try to ensure that the experience is consistent regardless of how you get your data into Shopify. I think this would also affect the Shopify Email experience as well, which depends on the double opt-in for certain merchants who require it based on their local laws.

 

I'd be happy to chat at any point about any ways we can help or test any solutions out. Thanks again!

hargitanandor
Tourist
3 0 2

Dear @Alan and @MarcBaumbach I've came across the problem too. We at OptiMonk are a website personalization tool that offers subscription popups and embedded solutions and some of our customers are required to use double opt-in, but the Admin API's Customer resource (we're using the REST API) doesn't triggers the DOI confirmation.

I think we tried the same as @MarcBaumbach earlier this year.

Is there and news @Alan about the DOI triggering via Admin API?

 

Can you elaborate WHY the API does not work this way we need? Why on earth does the marketing opt-in level contain the confirmed_opt_in setting in a PUT action if it doesn't work - both in REST and GraphQL the option is there?

 

Thanks in advance.

rmk-dev
Shopify Partner
6 0 1

Dear @Alan, is there an update on this?

rmk-dev
Shopify Partner
6 0 1

Dear @Alan, is there an update on this? It seems that the behavior is still unchanged. Using the GraphQL Storefront API works fine for new users. But for existing users it's impossible to trigger the opt-in email without having the user's password, which is necessary for the updateCustomer mutation request. That is really inconvenient in this case.

jback
Shopify Partner
5 0 5

Hey @Alan We'd love to see this capability added to the API as well. We have several merchants requesting it particularly from the EU.

 

Also, curious to know if anyone has found a workaround using Shopify Flow? 

dimileeh
Shopify Partner
1 0 0

createCustomer mutation request through the Storefront API requires passing `password` as a mandatory parameter. As a result, it's not possible to use this method to implement a newsletter signup form through Hydrogen.

 

So we've got two options:

- Implement Email Subscription mutation that would allow double opt-in

- Implement double opt-in on Admin API CustomerInput mutation.

 

It's a pity that this problem isn't solved 2 years since this question was asked, though I'm really impressed with Hydrogen and Oxygen overall.

Louro
Visitor
1 0 1

Hi @Alan , could you please confirm if it is still not possible to trigger double opt-in emails through REST API (only Storefront)? 

Thank you! 

Kalen_Jordan
Shopify Partner
779 36 141

Any update on this?

anitsirk
Shopify Partner
8 0 4

Shopify merchant here. It is very frustrating to see that this 2 year old issue has not been addressed yet. Almost every Shopify popup app for newsletter registrations cannot be used in the EU market because the double opt-in function is missing. Could someone from Shopify Staff please explain what the situation is?

nhm1990
Shopify Partner
6 0 1

That's pretty frustrating. I've been sitting on this problem for half the week and have only just come across this post...

Even with Flow I have not yet managed to trigger such a mail.

You can say:
If "CustomerCreate" then ....

But the email marketing mail only goes out IF the user has already done double opt-in.