} catch (SoapFault $e) { $_SESSION["errorMessage"] = $e; header("Location: error.php"); } } //======================================================================== // Main //======================================================================== loginCheck(); if ($_SERVER["REQUEST_METHOD"] == "POST") { $envelope = buildEnvelope(); if (isset($_POST["SendNow"])) { sendNow($envelope); exit; } else { embedSending($envelope); } } else { if ($_SERVER["REQUEST_METHOD"] == "GET") { echo ""; } } ?> <!DOCTYPE html"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="css/default.css" /> <link rel="stylesheet" href="css/jquery.ui.all.css" /> <link rel="stylesheet" type="text/css" href="css/SendDocument.css" />
function createSampleEnvelope() { // Create envelope information $envinfo = new EnvelopeInformation(); $envinfo->Subject = $_POST["subject"]; $envinfo->EmailBlurb = $_POST["emailblurb"]; $envinfo->AccountId = $_SESSION["AccountID"]; if ($_POST["reminders"] != null) { $remind = new DateTime($_POST["reminders"]); $new = new DateTime($_SERVER['REQUEST_TIME']); $days = $now->diff($remind)->d; if ($envinfo->Notification == null) { $envinfo->Notification = new Notification(); } $envinfo->Notification->Reminders = new Reminders(); $envinfo->Notification->Reminders->ReminderEnabled = true; $envinfo->Notification->Reminders->ReminderDelay = $days; $envinfo->Notification->Reminders->ReminderFrequency = "2"; } if ($_POST["expiration"] != null) { $expire = new DateTime($_POST["reminders"]); $new = new DateTime($_SERVER['REQUEST_TIME']); $days = $now->diff($expire)->d; if ($envinfo->Notification == null) { $envinfo->Notification = new Notification(); } $envinfo->Notification->Expirations = new Expirations(); $envinfo->Notification->Expirations->ExpireEnabled = true; $envinfo->Notification->Expirations->ExpireDelay = $days; $envinfo->Notification->Expirations->ExpireFrequency = "2"; } // Get all recipients $recipients = constructRecipients(); // Construct the template reference $tref = new TemplateReference(); $tref->TemplateLocation = TemplateLocationCode::Server; $tref->Template = $_POST["TemplateID"]; $tref->RoleAssignments = createFinalRoleAssignments($recipients); $trefs = array($tref); if (isset($_POST["SendNow"])) { sendNow($trefs, $envinfo, $recipients); } else { embedSending($trefs, $envinfo, $recipients); } }