Shopify创建用户激活电子邮件

时间:2019-02-21 18:13:56

标签: c# shopify shopify-app

使用Shopify Storefront API时如何禁用激活电子邮件:https://help.shopify.com/en/api/custom-storefronts/storefront-api/guides/updating-customers#creating-an-access-token

{
  "input": {
    "email": "user@example.com",
    "password": "HiZqFuDvDdQ7"
  }
}

当我尝试添加时:

send_email_welcome": false

编辑:

                Variables = new
                {
                    input = new
                    {
                        email = model.Email,
                        password = model.Password,
                        firstName = model.FirstName,
                        lastName = model.LastName
                    },
                    sendemailwelcome = false
                }

我得到一个错误。

当我查看他们的Store API时,您可以跳过激活电子邮件: https://help.shopify.com/en/api/reference/customers/customer#account_activation_url

1 个答案:

答案 0 :(得分:1)

我能够使用ShopifyShart解决此问题。原来,当您使用密码选项创建CreateAsync()时,可以在此处设置邀请电子邮件:

        var data = await m_service.CreateAsync(new Customer
            {
                Email = user.Email,
                FirstName = user.FirstName,
                LastName = user.LastName
            },
            new CustomerCreateOptions
            {
                SendEmailInvite = false,
                SendWelcomeEmail = false,
                Password = password,
                PasswordConfirmation = password
            });