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 | |
// Get token_secret from Settings page | |
$inbox_hooks_access_token = 'secret_token_here' | |
// Get the given (POSTed) digest | |
$headers = getallheaders(); | |
if(!isset($headers['X-InboxHooks-Post-Auth'])){ | |
header('HTTP/1.1 401 Unauthorized'); | |
echo "Failed authentication, no X-InboxHooks-Post-Auth was present"; |
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
import hmac | |
# Get token_secret from Settings page | |
inbox_hooks_access_token = 'secret_token_here' | |
hmac_hexdigest = hmac.new(inbox_hooks_access_token, request.raw_post_body).hexdigest() | |
if hmac_hexdigest == request.headers['X-InboxHooks-Post-Auth']: | |
return True | |
return False |
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
{ | |
"view":"cv", | |
"to_address":[ | |
"to_address@example.com", | |
"to_address_2@example.com" | |
], | |
"from_address":"no-reply@example.com", | |
"cc_address":[ | |
"cc1@example.com", | |
"cc2@example.com" |
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 | |
header('Content-Type: application/json'); | |
echo json_encode($key_pairs_here); | |
exit; | |
?> |
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 | |
header('Content-Type: text/html'); | |
echo $html_is_here; | |
exit; | |
?> |
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
div.ih_cv_sidebar div { | |
border:red; | |
} |
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 | |
// Do Authentication | |
// - see Important Notes in Docs | |
// Get raw POST data | |
$raw_post = @file_get_contents('php://input'); | |
// json_decode into an Array | |
$details = json_decode($raw_post); |
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
<div id="ih_cv_sidebar"> | |
<div class="ih_row" ih_row_num="1"> | |
HTML from Webhook #1 goes here | |
</div> | |
<div class="ih_row" ih_row_num="2"> | |
HTML from Webhook #2 goes here | |
</div> | |
</div> |
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
{"view":"cv","to_address":["to_address@example.com"],"from_address":"no-reply@example.com","cc_address":[],"subject":"This is the subject of the email","thread_id":"1342f5223ss9028e1710","date_received":"Sun, Dec 11, 2011 at 2:51 PM"} |
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 | |
// Get the raw post string | |
$raw_post = @file_get_contents('php://input'); | |
// Parse using json_decode | |
$post = json_decode($raw_post); | |
// $post now contains the JSON object |
OlderNewer