Created
August 8, 2018 09:47
Web-hook create and update
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
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)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How is this patch implemented?