enabling emails to the user that submitted the event on the front page event submission
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 18 Jul 2017 18:00:43 +0000 (14:00 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 18 Jul 2017 18:00:43 +0000 (14:00 -0400)
models/front/events/frontAdd.php

index 2bfa618..5a2730e 100644 (file)
@@ -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' );