// Send confirmation email, set the content type to allow html by using this filter
add_filter( 'wp_mail_content_type', array( $this, 'set_content_type' ) );
+ // Set the Reply-To to use Admin Contact E-Mail
+ $replyTo = ( $event['fieldData']['admin_email'] ) ? $event['fieldData']['admin_email']: $notify_from;
$subject = 'Event Form Submission';
$message = $htmlMessage;
$header[] = 'From:' . $notify_from;
- $header[] = 'Reply-To:' . $notify_from;
+ $header[] = 'Reply-To:' . $replyTo;
wp_mail( $notify_to, $subject, $message, $header );
GLM_MEMBERS_PLUGIN_VERSION
);
wp_enqueue_script('glm-members-front-maskedinput');
-
+
// Set initial values for variables.
$fromDate = '';
$permalink = '';
//Load Events class
$events = new GlmDataEvents($this->wpdb, $this->config );
$newEvent = $events->newEntry();
-
+
$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 */
} else {
// parse dates and times
// }
// // Send confirmation email, set the content type to allow html by using this filter
add_filter( 'wp_mail_content_type', 'set_content_type' );
-
+
$site_name = get_bloginfo('name');
$to = $to_email;
$subject = 'Event Form Submission';
-
+
$message = $htmlMessage;
$userBody = $userMessage;
$header[] = "From: $site_name <$fromEmail>";
- $header[] = 'Reply-To:' . $adminEmail;
-
+ $header[] = 'Reply-To:' . $adminEmail;
+
wp_mail($to, $subject, $message, $header);
-
+
// send a copy to the user submitting the email, using different headers and email template file
$userHeader[] = "From: $site_name <$fromEmail>";
- $userHeader[] = 'Reply-To: No-Reply@gaslightmedia.com';
-
+ $userHeader[] = 'Reply-To: No-Reply@gaslightmedia.com';
+
if(wp_mail($adminEmail, $subject, $userBody, $userHeader)){
-
+
} else {
echo "Error: Message Not Sent";
}
-
+
// remove the filter to avoid conflicts
remove_filter( 'wp_mail_content_type', 'set_content_type' );
}
'to_email' => $to_email,
'from_email' => $fromEmail,
'notification' => $emailNotification,
- 'confirmation_page' => $redirect_url,
+ 'confirmation_page' => $redirect_url,
'mainImgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/large/'
);