insertRows(MainController::KOMPASS_EVENTS_PARTICIPANTS, $postedData)) { $errorPage = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/error.webseite.php'); $errorPage = sprintf($errorPage, $postedData['vorname'] ); wp_mail('thomas@pfadfinden-halle.de', 'Anmeldung für Pfingstlager fehlerhaft', print_r($postedData, true)); return $errorPage; } $successMail = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/done.email.php'); $successMail = sprintf($successMail, $postedData['vorname'], \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']) ); $successPage = file_get_contents(dirname(__FILE__) . '/../Templates/Partials/Registration/done.webseite.php'); $successPage = sprintf($successPage, $postedData['vorname'], \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']) ); $sent = wp_mail( $postedData['email_1'], 'Anmeldung zum Pfingstlager 2024 in Taucha', $successMail, ['Reply-To: thomas@pfadfinden-halle.de', 'Content-Type: text/html; charset=UTF-8']); if ('' !== $postedData['email_2']) { $sent = wp_mail( $postedData['email_2'], 'Anmeldung zum Pfingstlager 2024 in Taucha', $successMail, ['Reply-To: thomas@pfadfinden-halle.de', 'Content-Type: text/html; charset=UTF-8']); } return $successPage; } }