Skip to content

Commit 9b3fe3e

Browse files
committed
[Fixes #32] Customer - Send invite
1 parent a1fcdec commit 9b3fe3e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ The custom methods are specific to some resources which may not be available for
343343
- Customer ->
344344
- [search()](https://help.shopify.com/api/reference/customer#search)
345345
Search for customers matching supplied query
346+
- [send_invite($data)](https://help.shopify.com/en/api/reference/customers/customer#send_invite)
347+
Sends an account invite to a customer.
346348

347349
- Customer -> Address ->
348350
- [makeDefault()](https://help.shopify.com/api/reference/customeraddress#default)

lib/Customer.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,20 @@ class Customer extends ShopifyResource
4444
'Metafield',
4545
'Order'
4646
);
47+
48+
/**
49+
* Sends an account invite to a customer.
50+
*
51+
* @param array $customer_invite Customized invite data
52+
*
53+
* @return array
54+
*/
55+
public function send_invite($customer_invite = array())
56+
{
57+
if (empty ( $customer_invite ) ) $customer_invite = new \stdClass();
58+
$url = $this->generateUrl(array(), 'send_invite');
59+
$dataArray = $this->wrapData($customer_invite, 'customer_invite');
60+
61+
return $this->post($dataArray, $url, false);
62+
}
4763
}

0 commit comments

Comments
 (0)