phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
568 stars 211 forks source link

Create Customer generates incorrect customer.account_activation_url #232

Closed lobbyof closed 3 years ago

lobbyof commented 3 years ago

Hi,

Since about July 5th, our customers have been unable to click the standard Activate Your Account button in the Welcome Email.

The liquid variable in the template is the default: {{ customer.account_activation_url }}

However, on clicking it, the customer is brought to the Reset Password page, not the Activate Account page.

On investigation, I replaced the call:

$shopify->Customer->post($new_customer);

with a direct PHP cURL call to the endpoint: /admin/api/2021-04/customers.json

And this worked. Note, I also had to wrap my existing $new_customer array in: $customer = array( "customer" => $new_customer ); before json_encoding it for it to work with the newer API version.

What API version does the SDK use?

joseph-sx commented 3 years ago

@lobbyof The lib is using version 2021-01 by default, you can update it using the config array

$config = array(
    'ShopUrl' => 'yourshop.myshopify.com',
    'ApiKey' => '***YOUR-PRIVATE-API-KEY***',
    'Password' => '***YOUR-PRIVATE-API-PASSWORD***',
    'ApiVersion' => '2021-04'
);