Merge branch 'contactform'
All checks were successful
Deploy Hugo / deploy (push) Successful in 35s

This commit is contained in:
Jens M. Sauer 2024-10-24 13:26:29 +02:00
commit b9eb0b6f3c
9 changed files with 6901 additions and 1 deletions

View File

@ -7,6 +7,9 @@ title: Banner
params: params:
subtitle: Benvenuto und herzlich Willkommen! subtitle: Benvenuto und herzlich Willkommen!
style: style1 orient-left content-align-left image-position-center fullscreen onload-image-fade-in onload-content-fade-right style: style1 orient-left content-align-left image-position-center fullscreen onload-image-fade-in onload-content-fade-right
button:
link: Kontakt
label: Jetzt Kontakt aufnehmen
--- ---
Aus Italien auf Ihre Feier in Norddeutschland. Aus Italien auf Ihre Feier in Norddeutschland.

View File

@ -3,6 +3,30 @@
<div class="inner"> <div class="inner">
<h2>{{ .Title }}</h2> <h2>{{ .Title }}</h2>
<p>{{ .Content }}</p> <p>{{ .Content }}</p>
<br>
<h3>Oder verwendet das Kontaktformular</h3>
<form id="contactForm">
<div class="fields">
<div class="field half">
<label for="name">Name:</label>
<input type="text" name="name" id="name" required>
</div>
<div class="field half">
<label for="email">E-Mail:</label>
<input type="email" name="email" id="email" required>
</div>
<div class="field">
<label for="message">Nachricht:</label>
<textarea name="message" id="message" rows="5" required></textarea>
</div>
</div>
<ul class="actions">
<li>
<button type="submit">Absenden</button>
</li>
</ul>
</form>
<div id="responseMessage" style="margin-top:20px;"></div>
</div> </div>
</section> </section>
{{ end }} {{ end }}

View File

@ -0,0 +1,28 @@
<?php
/**
* German PHPMailer language file: refer to English translation for definitive list
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
$PHPMAILER_LANG['connect_host'] = 'SMTP-Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-Fehler: Daten werden nicht akzeptiert.';
$PHPMAILER_LANG['empty_message'] = 'E-Mail-Inhalt ist leer.';
$PHPMAILER_LANG['encoding'] = 'Unbekannte Kodierung: ';
$PHPMAILER_LANG['execute'] = 'Konnte folgenden Befehl nicht ausführen: ';
$PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
$PHPMAILER_LANG['file_open'] = 'Dateifehler: Konnte folgende Datei nicht öffnen: ';
$PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: ';
$PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.';
$PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: ';
$PHPMAILER_LANG['invalid_hostentry'] = 'Ungültiger Hosteintrag: ';
$PHPMAILER_LANG['invalid_host'] = 'Ungültiger Host: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: ';
$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Verbindung zum SMTP-Server fehlgeschlagen.';
$PHPMAILER_LANG['smtp_error'] = 'Fehler vom SMTP-Server: ';
$PHPMAILER_LANG['variable_set'] = 'Kann Variable nicht setzen oder zurücksetzen: ';
$PHPMAILER_LANG['extension_missing'] = 'Fehlende Erweiterung: ';

View File

@ -0,0 +1,40 @@
<?php
/**
* PHPMailer Exception class.
* PHP Version 5.5.
*
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
*
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2020 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
namespace PHPMailer\PHPMailer;
/**
* PHPMailer exception handler.
*
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
*/
class Exception extends \Exception
{
/**
* Prettify error message output.
*
* @return string
*/
public function errorMessage()
{
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

45
static/contactform.php Normal file
View File

@ -0,0 +1,45 @@
<?php
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = htmlspecialchars($_POST['name']);
$email = htmlspecialchars($_POST['email']);
$message = htmlspecialchars($_POST['message']);
$config = parse_ini_file('/var/www/vhosts/hosting205886.ae948.netcup.net/bar-filipo.de/credentials/config.ini', true);
$mail = new PHPMailer(true);
try {
// SMTP-Einstellungen aus der Konfigurationsdatei laden
$mail->isSMTP();
$mail->Host = $config['smtp']['host'];
$mail->SMTPAuth = true;
$mail->Username = $config['smtp']['username'];
$mail->Password = $config['smtp']['password'];
$mail->SMTPAutoTLS = true;
$mail->Port = $config['smtp']['port'];
// E-Mail-Einstellungen
$mail->setFrom($config['smtp']['username'], 'Bar Filipo Kontaktformular');
$mail->addAddress($config['smtp']['recipient']);
$mail->isHTML(true);
$mail->Subject = 'Neue Nachricht vom Kontaktformular';
$mail->Body = "Name: $name<br>E-Mail: $email<br>Nachricht: $message";
$mail->AltBody = "Name: $name\nE-Mail: $email\nNachricht: $message";
$mail->addReplyTo($email, $name);
$mail->send();
echo 'Nachricht wurde erfolgreich gesendet.';
} catch (Exception $e) {
echo "Fehler beim Senden der Nachricht: {$mail->ErrorInfo}";
}
} else {
echo 'Ungültige Anfrage';
}
?>

3
static/info.php Normal file
View File

@ -0,0 +1,3 @@
<?php
phpinfo();
?>

@ -1 +1 @@
Subproject commit 0958fb404d10da595f9266b92987aff17d9b0a76 Subproject commit fdcad5ff5ea4afd360adf067f49730990a8664bc