Skip to content

Instantly share code, notes, and snippets.

@dergachev
Created November 11, 2015 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dergachev/1fda5cae9b11dcce9202 to your computer and use it in GitHub Desktop.
Save dergachev/1fda5cae9b11dcce9202 to your computer and use it in GitHub Desktop.
name = "EW Hellosign"
description = "Test Hellosign integration"
package = "Custom"
core = 7.x
<?php
function ew_hellosign_menu() {
$items['hellosign'] = array(
'page callback' => 'ew_hellosign_callback',
'access arguments' => array('access content'),
);
$items['hellosign_form'] = array(
'page callback' => 'ew_hellosign_form',
'access arguments' => array('access content'),
);
return $items;
}
# TODO: verify that its actually hellosign before doing anything with the data
function ew_hellosign_callback() {
return "Hello API Event Received";
}
function ew_hellosign_form() {
return '
<script type="text/javascript" src="//s3.amazonaws.com/cdn.hellofax.com/js/embedded.js"></script>
<script type="text/javascript">
HelloSign.init("713ee2392751e9ee9ded47e74913a9db");
HelloSign.open({
url: "https://www.hellosign.com/editor/embeddedSign?signature_id=10b57d1fb9ae6f2a5e50e79dfaea7178&token=32feb3e05339bfb15502c25991c01472",
allowCancel: true,
messageListener: function(eventData) {
alert("HelloSign event received");
console.log(eventData);
}
});
</script>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment