Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save projoomexperts/2ea9bde8c418bb85a1afa13d6120560f to your computer and use it in GitHub Desktop.
Save projoomexperts/2ea9bde8c418bb85a1afa13d6120560f to your computer and use it in GitHub Desktop.
Shopify Webhook to read customer registration
<?php
$webhookContent = "";
$webhook = fopen('php://input' , 'rb');
while (!feof($webhook)) {
$webhookContent .= fread($webhook, 4096);
}
fclose($webhook);
error_log($webhookContent);
$user = json_decode($webhookContent, true);
if($user[note] != ''){
$to = "[email protected]";
$subject = "New wholesaler signed up on society-plus.com";
$txt = "Hi, A new user ( Name : ". $user[first_name] . " " . $user[last_name] . " , Email : " . $user[email] . ") Just registered to the store and want to be a wholesaler. Below is his/her details ( ". $user[note] ." )";
$headers = "From: [email protected]" . "\r\n" .
"CC: [email protected]";
mail($to,$subject,$txt,$headers);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment