{source}
[[h2]]Sign Documents Now[[/h2]]
[[p id="getdocusignurl"]][[/p]] //this is where the URL should appear
[[button]]Sign Documents Now[[/button]]
[[script type="text/javascript"]]
jQuery(document).ready(function(){
jQuery("button").click(function(){
jQuery.getJSON('https://us12b.sheltermanager.com/service?account=xxxxx&method=json_report&username=xxxxx&password=xxxxx&title=DocuSign+Integration+for+Volunteers&email=[[?php echo $user->email; ?]]',
function(data) {
var dt = JSON.stringify(data).replace('[', '').replace(']', '');
if (dt) {
var result = JSON.parse(dt);
var firstname = result.OWNERFORENAMES;
var lastname = result.OWNERSURNAME;
var address = result.OWNERADDRESS;
var city = result.OWNERTOWN;
var state = result.OWNERCOUNTY;
var email = result.EMAILADDRESS;
var zip = result.OWNERPOSTCODE;
var uri = "https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=a221aedd-bce2-44fd-bb2d-17d513486bd8&env=na3&acct=xxxx&v=2&Volunteer_UserName=" + firstname + " " + lastname + "&Volunteer_Email=" + email + "&Volunteer_Address=" + address + "&Volunteer_City=" + city + "&Volunteer_State=" + state + "&Volunteer_Zip=" + zip;
var url = encodeURI(uri);
console.log(url)
document.getElementById("getdocusignurl").innerHTML = url;
}
})
})
});
[[/script]]
{/source}