insertRows(MainController::KOMPASS_EVENTS_PARTICIPANTS, $postedData)) { $errorPage = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/error.webseite.php'); $errorPage = sprintf($errorPage, $postedData['vorname'], $event->event_email, $event->event_name, $event->event_email ); wp_mail($event->event_email, 'Anmeldung für "' . $event->event_name . '" fehlerhaft', print_r($postedData, true)); return $errorPage; } $successMail = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/done.email.php'); $successMail = sprintf($successMail, $postedData['vorname'], $event->event_name, \DateTime::createFromFormat('Y-m-d', $postedData['anreise'])->format('d.m.Y'), \DateTime::createFromFormat('Y-m-d', $postedData['abreise'])->format('d.m.Y'), ucfirst($postedData['essgewohnheit']), $event->event_email, $event->event_name, $event->event_email ); $successPage = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/done.webseite.php'); $successPage = sprintf($successPage, $postedData['vorname'], $event->event_name, \DateTime::createFromFormat('Y-m-d', $postedData['anreise'])->format('d.m.Y'), \DateTime::createFromFormat('Y-m-d', $postedData['abreise'])->format('d.m.Y'), ucfirst($postedData['essgewohnheit']), $event->event_email, $event->event_name, $event->event_email ); $sent = wp_mail( $postedData['email_1'], 'Anmeldung zu "' . $event->event_name . '"', $successMail, ['Reply-To: ' . $event->event_email, 'Content-Type: text/html; charset=UTF-8']); if ('' !== $postedData['email_2']) { $sent = wp_mail( $postedData['email_2'], 'Anmeldung zu "' . $event->event_name . '"', $successMail, ['Reply-To: ' . $event->event_email, 'Content-Type: text/html; charset=UTF-8']); } return $successPage; } }