public function checkoutUpdateInventoryAndNotify($summary = '', $requestId = false)
{
+ $RegEvent = new GlmDataRegistrationsRegEvent($this->wpdb, $this->config);
+
// If a request ID is supplied, load that cart
if ($requestId) {
getRegistrationCart($requestId, false, true);
}
-//echo "<pre>".print_r($this->config['settings'],1)."</pre>";
-
-
-
- require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php';
- $RegMisc = new GlmDataRegistrationsMisc($this->wpdb, $this->config);
- $regMisc = $RegMisc->getEntry(1);
-
-//echo "<pre>".print_r($this->cart,1)."</pre>";
-
+ // Get the misc settings for registrations
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php';
+ $RegMisc = new GlmDataRegistrationsMisc($this->wpdb, $this->config);
+ $regMisc = $RegMisc->getEntry(1);
+ // Set view data for site owner, person submitting the event and the event contacts
+ $viewData = array(
+ 'events' => $this->cart['events'],
+ 'summary' => $summary
+ );
/*
* Send notification to site owner
*/
$emailAddr = $this->config['settings']['reg_org_internal_email'];
if (trim($emailAddr) != '' && trim($summary) != '') {
- $viewData = array(
- 'summary' => $summary
- );
- $emailMsg = nl2br($regMisc['notify_text'])."\n\n".$summary;
+ $subjectLine = $this->generateHTML($viewData, $regMisc['notify_subject'], true);
+ $emailMsg = $this->generateHTML($viewData, nl2br($regMisc['notify_text']), true)."\n\n".$summary;
mail($emailAddr, $regMisc['notify_subject'], $emailMsg);
-//echo "<p>E-Mail to site owner</p><hr>$emailMsg<hr>";
}
-
/*
* Send notification to person submitting request
*/
$emailAddr = $this->cart['accounts'][$accountId]['contact_email'];
}
if ($emailAddr != '') {
- $viewData = array(
- 'summary' => $summary
- );
- $emailMsg = nl2br($regMisc['submission_notify_text'])."\n\n".$summary;
- mail($emailAddr, $regMisc['submission_notify_subject'], $emailMsg);
-//echo "<p>E-Mail to person submitting registrations</p><hr>$emailMsg<hr>";
- } else {
-//echo "<hr><p>No email address for person submitting registrations.<p><hr>";
+ $subjectLine = $this->generateHTML($viewData, $regMisc['submission_notify_subject'], true);
+ $emailMsg = $this->generateHTML($viewData, nl2br($regMisc['submission_notify_text']), true)."\n\n".$summary;
+ mail($emailAddr, $subjectLine, $emailMsg);
}
}
-
// For each event
- foreach ($this->cart[events] as $event) {
-
- /*
- * Send notifications to contcts listed in event
- */
- // Need to add contact addresses
+ foreach ($this->cart['events'] as $event) {
+ $eventRegistrants = array();
// For each class
foreach ($event['classes'] as $class) {
// For each registrant
foreach ($rate['registrants'] as $registrant) {
-/*
+
// Adjust the inventory and hold numbers
$this->updateTimeEntryCounts($registrant['reg_time'], -1, 1);
'registrant' => $registrant['id']
)
);
-*/
+
// Send registrant a confirmation
$accountId = $registrant['account'];
if (isset($this->cart['accounts'][$accountId])) {
$emailAddr = $this->cart['accounts'][$accountId]['contact_email'];
}
if ($emailAddr != '') {
- $viewData = $registrant;
-//echo "<pre>".print_r($registrant,1)."</pre>";
+ $viewData['registrant'] = $registrant;
+ $subjectLine = $this->generateHTML($viewData, $regMisc['registrant_notify_subject'], true);
$emailMsg = $this->generateHTML($viewData, nl2br($regMisc['registrant_notify_text']), true);
- mail($emailAddr, $regMisc['registrant_notify_subject'], $emailMsg);
-//echo "<p>E-Mail to registrant: ".$registrant['fname']." ".$registrant['lname']."</p><hr>$emailMsg<hr>";
- } else {
-//echo "<hr><p>No email address for this registrant.<p><hr>";
+ mail($emailAddr, $subjectLine, $emailMsg);
}
-
}
-
- $registrantEmail = $this->config['settings']['?????'];
-
+ $eventRegistrants[] = $registrant;
}
}
}
+
+ /*
+ * Send notifications to contcts listed in event
+ */
+ $viewData['event'] = $event;
+ $eventOther = $RegEvent->getRegEventSimplified($event['reg_event']);
+ $emailAddr = $eventOther['notify_email'];
+ if (trim($emailAddr) != '') {
+ $viewData['eventRegistrants'] = $eventRegistrants;
+ $subjectLine = $this->generateHTML($viewData, $regMisc['instr_notify_subject'], true);
+ $emailMsg = $this->generateHTML($viewData, nl2br($regMisc['instr_notify_text']), true);
+ mail($emailAddr, $subjectjectLine, $emailMsg);
+ }
+
}
}
}
+
+
+
+
/*
* Get a quick summary of a registration request (cart)
*
array( 'id' => $requestId ),
$reqFormat
);
-// Check if properly stored ..... Retrieve and test. Send E-Mail if not able to store
+
+ // Check if not properly stored ..... Send E-Mail to developers
+ if ($updated != 1) {
+ $reqData['user_trace_info'] = unserialize($reqData['user_trace_info']);
+ $reqData['REQUEST'] = $_REQUEST;
+ $reqData['REQUEST']['cc_numb'] = '(suppressed)';
+ $requestText = print_r($reqData,1);
+ mail('cscott@gaslightmedia.com', 'Registration Add-On Failure:', $requestText);
+ $messages[] =
+ 'Oops, we had a technical problem of some sort. '
+ .'Our shiny new servers were unable to store the request you submitted but have already taken the precaution to notify us. '
+ .'If you paid by credit card, your card make have already been processed. '
+ .'Please contact us immediately for assistance and refer to the following request #.'
+ .'<br><b>Request# '.$_SESSION['glm_reg_cart_id'].'</b>'
+ .'<br>Phone: '.$this->config['settings']['reg_org_phone']
+ .', Toll Free: '.$this->config['settings']['reg_org_toll_free'];
+ }
// Get the updated information for the request and account
$request = $Request->getEntry($this->cart['request']['id']);
$account = $Account->getEntry($request['account']);
-
/*
* If there's been a problem, use model redirect to go back to the checkout page
*/
);
}
-
/*
* Successful checkout
*/