'Newsletter-Anmeldung bestaetigen', 'bodyHTML' => '

' . implode('

', $bodyConfirmation) . '

', 'bodyText' => implode("\n\n", $bodyConfirmation), 'fromAddress' => '***REMOVED***', // 'newsletter@tobias-radloff.de' 'fromName' => 'Tobias Radloffs Newsletter' ]; // check if email parameter is set if ( ! isset($_POST['email']) ) { GracefulExit($errorURL, "{$err}: Keine Emailadresse angegeben."); } // check if it's a well-formed email address $email = filter_var(trim($_POST['email'], FILTER_SANITIZE_STRING)); if ( ! filter_var($email, FILTER_VALIDATE_EMAIL)) { GracefulExit($errorURL, "{$err}: Ungültige Emailadresse {$email}"); } // check whether address is already subscribed try { $check = NotYetSubscribed($email); if ( gettype($check) == 'string' ) { GracefulExit($errorURL, "{$err}: {$check}."); } } catch (\PDOException $e) { GracefulExit($errorURL, "{$err}: {$e->getMessage()}"); } // build and add link to $confirmQuery = http_build_query(['c' => GetConfirmationHash($email), 'e' => $email]); $confirmLink = $general['siteURL'] . $general['confirmScript'] . "?" . $confirmQuery; $mailConfirmation['bodyHTML'] = str_replace('%Placeholder%', $confirmLink, $mailConfirmation['bodyHTML']); $mailConfirmation['bodyText'] = str_replace('%Placeholder%', $confirmLink, $mailConfirmation['bodyText']); // send email try { SendEmail($email, $mailConfirmation); } catch (Exception $e) { GracefulExit($errorURL, "{$err}: {$e->getMessage()}"); } // success GracefulExit($successURL, "Anmeldung erfolgreich: Email mit Bestätigungslink wurde an {$email} versandt."); ?>