From 33d431a1432a3719e8ad0839fbf68fce4cc65486 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 18 Jul 2017 14:00:43 -0400 Subject: [PATCH] enabling emails to the user that submitted the event on the front page event submission --- models/front/events/frontAdd.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/models/front/events/frontAdd.php b/models/front/events/frontAdd.php index 2bfa618..5a2730e 100644 --- a/models/front/events/frontAdd.php +++ b/models/front/events/frontAdd.php @@ -665,19 +665,24 @@ class GLmMembersFront_events_frontAdd extends GlmDataEvents $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; wp_mail($to, $subject, $message, $header); - $userHeader[] = 'From:' . $to[0]; + // send a copy to the user submitting the email, using different headers and email template file + $userHeader[] = 'From: ' . $fromEmail; $userHeader[] = 'Reply-To: No-Reply@gaslightmedia.com'; -// wp_mail('anthony@localhost', $subject, $userBody, $userHeader); + 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' ); -- 2.17.1