$events = new GlmDataEvents($this->wpdb, $this->config );
$newEvent = $events->newEntry();
- $pageID = get_option('glm_members_database_option_event_confirmation_id');
- $redirect_url = get_permalink($pageID);
+ $confirmation_page_id = get_option('glm_members_database_option_event_confirmation_id');
+ $redirect_url = get_permalink($confirmation_page_id);
// if form is submitted
if ( isset( $_REQUEST['newEvent'] ) && $_REQUEST['newEvent'] == "Add Event" ) {
// Check to see if the honey pot caught spam.
if ( isset( $_REQUEST['real_email'] ) && $_REQUEST['real_email'] ) {
-// $view = 'confirmation';
- header("Location: $redirect_url"); /* Redirect browser */
+ $view = 'confirmation';
+
+// header("Location: $redirect_url"); /* Redirect browser */
} else {
// parse dates and times
date_default_timezone_set('America/New_York');
require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php';
$viewFile = 'front/events/ownerEmail.html';
+ $userEmailFile = 'front/events/userEmail.html';
// Generate output from model data and view
$htmlMessage = $smarty->template->fetch($viewFile);
+ $userMessage = $smarty->template->fetch($userEmailFile);
function set_content_type(){
return "text/html";
$to = $to_email;
$subject = 'Event Form Submission';
$message = $htmlMessage;
+ $userBody = $userMessage;
$headers = 'From:' . $fromEmail . "\r\n" .
'Reply-To:' . $contactEmail;
$header[] = 'From:' . $fromEmail;
- $header[] = 'Reply-To:' . $contactEmail;
-
+ $header[] = 'Reply-To:' . $contactEmail;
+
wp_mail($to, $subject, $message, $header);
-
+
+ $userHeader[] = 'From:' . $to[0];
+ $userHeader[] = 'Reply-To: No-Reply@gaslightmedia.com';
+
+// wp_mail('anthony@localhost', $subject, $userBody, $userHeader);
+
// remove the filter to avoid conflicts
remove_filter( 'wp_mail_content_type', 'set_content_type' );
}
-// $view = 'confirmation';
- header("Location: $redirect_url"); /* Redirect browser */
+ $view = 'confirmation';
+// header("Location: $redirect_url"); /* Redirect browser */
}
}
// Compile template data
$templateData = array(
- 'members' => $members,
- 'venues' => $venues,
- 'eventAmenities' => $eventAmenities,
- 'memberManager' => $memberManager,
- 'memberOnly' => $memberOnly,
- 'memberContact' => $memberContact,
- 'states' => $this->config['states'],
- 'state_def' => $default_state,
- 'siteBaseUrl' => GLM_MEMBERS_EVENTS_SITE_BASE_URL,
- 'currentUrl' => ((isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''),
- 'categories' => $eventCategories,
- 'fromDate' => $fromDate,
- 'event' => $newEvent,
- 'permalink' => $permalink,
- 'title' => $title,
- 'to_email' => $to_email,
- 'from_email' => $fromEmail,
- 'notification' => $emailNotification,
+ 'members' => $members,
+ 'venues' => $venues,
+ 'eventAmenities' => $eventAmenities,
+ 'memberManager' => $memberManager,
+ 'memberOnly' => $memberOnly,
+ 'memberContact' => $memberContact,
+ 'states' => $this->config['states'],
+ 'state_def' => $default_state,
+ 'siteBaseUrl' => GLM_MEMBERS_EVENTS_SITE_BASE_URL,
+ 'currentUrl' => ((isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''),
+ 'categories' => $eventCategories,
+ 'fromDate' => $fromDate,
+ 'event' => $newEvent,
+ 'permalink' => $permalink,
+ 'title' => $title,
+ 'to_email' => $to_email,
+ 'from_email' => $fromEmail,
+ 'notification' => $emailNotification,
+ 'confirmation_page' => $redirect_url,
'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/'
);
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8">
+ </head>
+ <body>
+ <h1 id="title"> Event Submission Notification</h1>
+
+ <table cellspacing="0" cellpadding="0" width="500" style="background: lightgrey;border:1px solid #ccc;border-collapse:collapse;">
+ <tr>
+ <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;">Event Name:</td>
+ <td style="width:200px;padding:5px;border:1px solid #ccc;">{$name}</td>
+ </tr>
+ <tr>
+ <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;">Event Start Date: </td>
+ <td style="width:200px;padding:5px;border:1px solid #ccc;"> {$startDate} </td>
+ </tr>
+ {if $endDate}
+ <tr>
+ <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;" >Event End Date:</td>
+ <td style="width:200px;padding:5px;border:1px solid #ccc;" >{$endDate}</td>
+ </tr>
+ {/if}
+ {if $startTime}
+ <tr>
+ <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;">Event Start Time:</td>
+ <td style="width:200px;padding:5px;border:1px solid #ccc;">{$startTime}</td>
+ </tr>
+ {/if}
+ {if $endTime}
+ <tr>
+ <td style="font-weight:bold;width:200px;padding:5px;border:1px solid #ccc;">Event End Time:</td>
+ <td style="width:200px;padding:5px;border:1px solid #ccc;">{$endTime}</td>
+ </tr>
+ {/if}
+ </table>
+
+ <div id="emailFooter">
+ <p style="margin-bottom: 0px;">Thank you for submitting your event, please allow up to 48 hours for the event to be reviewed.</p>
+ </div>
+ </body>
+</html>
\ No newline at end of file