Created
November 27, 2019 13:55
-
-
Save freyandhy/ed12551dcd3fda1a18ac6b5c90102675 to your computer and use it in GitHub Desktop.
Testing Get Name at WooCommerce Email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/ | |
$name = $order->get_formatted_billing_full_name(); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://hooks.slack.com/services/ss/x/x'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
// curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"text\":\"@here Ada 1 Order Nih\"}"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"text\":\"@here Halo, ada yang order nih dari si $name\"}"); | |
$headers = array(); | |
$headers[] = 'Content-Type: application/json'; | |
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); | |
$result = curl_exec($ch); | |
if (curl_errno($ch)) { | |
echo 'Error:' . curl_error($ch); | |
} | |
curl_close($ch); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment