API Add Customer Email send Double Opt In

Hi there,

is there a way to automatically send a double opt in email to a customer created with the API?

Im using

POST /admin/api/2019-10/customers.json

to create a new customer:

{
“customer”: {
“first_name”: “”,
“email”: “email@example.com”,
“accepts_marketing”: true,
“send_email_invite”: true <---- This only sends the “Account Activation Email” but does not confirm the double opt in
}
}

Is there such an option for the double opt in invite email?

Thanks for your help!

5 Likes

Hi,
any update on this topic? I am also interested in solution of this issue.

1 Like

I’d also like a reply for this. The fact that Shopify supports this natively, means it should also work with the API.

Are there any updates on this? Currently struggling on that myself. I’m trying to build a custom newsletter signup page and somehow neither of the queries I tried seems to send the double opt-in marketing confirmation mail to $email.

mutation createCustomer(
      $email: String!
      $firstName: String!
      $lastName: String!
      $updatedAt: DateTime!
   ) {
      customerCreate(
         input: {
            email: $email
            firstName: $firstName
            lastName: $lastName
            emailMarketingConsent: {
               marketingOptInLevel: CONFIRMED_OPT_IN
               marketingState: PENDING
               consentUpdatedAt: $updatedAt
            }
            tags: ["example"]
         }
      ) {
         userErrors {
            field
            message
         }
         customer {
            firstName
            lastName
            email
         }
      }
   }

Is it still an issue?

I’m with OptiMonk, a website personalization tool that offers custom sign-up forms, and an increasing number of customers are asking about having a DOI option when integrating with Shopify.

If we set

CustomerMarketingOptInLevel 

to

CONFIRMED_OPT_IN 

in

CustomerEmailMarketingConsentInput 

in version 2022-10 - as written here: https://shopify.dev/api/admin-graphql/2022-10/enums/CustomerMarketingOptInLevel subscribers should get a confirmation email in an intermediate step as described here:

“After providing their information, the customer receives a confirmation and is required to perform a intermediate step before receiving marketing information.”

But it didn’t, right?

in this similar thread, Alan says it never worked.. .https://community.shopify.com/c/shopify-apis-and-sdks/trigger-double-opt-in-notification-for-customer-created-via-api/m-p/1858992/highlight/true#M85731