Skip to content

Instantly share code, notes, and snippets.

@sunilpawar
Created August 8, 2018 09:47
Web-hook create and update
diff --git a/CRM/Sparkpost.php b/CRM/Sparkpost.php
index 1c94882..9a448e0 100644
--- a/CRM/Sparkpost.php
+++ b/CRM/Sparkpost.php
@@ -117,6 +117,12 @@ class CRM_Sparkpost {
// ie. webhook, transmission but NOT webhook/id
// This is a create operation so use POST
curl_setopt($ch, CURLOPT_POST, TRUE);
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
+ }
+ else {
+ // ie. webhook/id
+ // update operation
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
}
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($content, JSON_UNESCAPED_SLASHES));
}
@andyburnsco
Copy link

How is this patch implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment