A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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?
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
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!
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.