Step 1) In your WeSupply account, you have to make sure that SMS Notifications are enabled. For this, navigate to Settings -> Branding -> Notifications → check off each Phone notification for the desired action type, ex: Shipment received, Shipment in Transit, Order received, Order canceled, etc.
After checking off the desired SMS notifications, simply click the SAVE button.
Step 2) Make a simple curl call with params order and phone, right after order placement (preferably from Thank You/Order Success Page to notify WeSupply.
The URL of this call is:URL: https://wesupply_client_url/api/phone/enrol
order: 000000198phone: 1234567890 (length of the phone must be greater than 10)
Params:
PHP Code example:
‘000000198’, "phone" = ‘1234567890’);$buildQuery = http_build_query($params);$url = “https://wesupply_client_url/api/phone/enrol”;$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL = $url.’?’.$buildQuery, CURLOPT_RETURNTRANSFER = true, CURLOPT_MAXREDIRS = 10, CURLOPT_TIMEOUT = 30, CURLOPT_CUSTOMREQUEST = "GET", CURLOPT_FOLLOWLOCATION = TRUE ));$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}?
Possible Responses: “true” – the call went ok and WeSupply was successfully notified
“error”: “Parameters missing!” - there are missing parameters in your call (order or phone) or the phone parameter has a length smaller than 10
For more information on SMS notifications:
Notifications Setup (Video)
How to Customize SMS Notifications (Written Documentation)
How to Enable/Disable SMS Notifications (Written Documentation)
Comments
0 comments
Please sign in to leave a comment.