diff --git a/content/php/confirm.php b/content/php/confirm.php index 43bf5ea..834bc84 100644 --- a/content/php/confirm.php +++ b/content/php/confirm.php @@ -1,18 +1,19 @@ '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."); @@ -20,7 +37,7 @@ if ( ! filter_var($email, FILTER_VALIDATE_EMAIL)) { // check whether address is already subscribed try { - $check = NotAlreadySubscribed($email); + $check = NotYetSubscribed($email); if ( gettype($check) == 'string' ) { GracefulExit($errorURL, "{$err}: {$check}."); } @@ -28,11 +45,15 @@ try { GracefulExit($errorURL, "{$err}: {$e->getMessage()}"); } -// send email with confirmation link +// 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, $confirmLink); + SendEmail($email, $mailConfirmation); } catch (Exception $e) { GracefulExit($errorURL, "{$err}: {$e->getMessage()}"); } diff --git a/content/php/unsubscribe.php b/content/php/unsubscribe.php index e0111b6..a247062 100644 --- a/content/php/unsubscribe.php +++ b/content/php/unsubscribe.php @@ -1,17 +1,19 @@ getMessage()}"); } + +// success +GracefulExit($successURL, 'Abmeldung erfolgt: Emailadresse ist aus dem Newsletter ausgetragen'); ?> \ No newline at end of file diff --git a/theme/static/css/custom.css b/theme/static/css/custom.css index cb5ac31..083477d 100644 --- a/theme/static/css/custom.css +++ b/theme/static/css/custom.css @@ -356,6 +356,7 @@ pre { .card-body img { height: var(--card-height); + object-fit: contain; }