forked from markus/AMPERION_Webpage
Update020920252221
This commit is contained in:
parent
6c64da0884
commit
6828c3f835
7 changed files with 130 additions and 77 deletions
|
|
@ -60,9 +60,9 @@ link = "contact"
|
||||||
|
|
||||||
# matomo tracking: see https://matomo.org/
|
# matomo tracking: see https://matomo.org/
|
||||||
[matomo]
|
[matomo]
|
||||||
enable = false
|
enable = true
|
||||||
url = "" # your matomo url
|
url = "https://matomo.amperion.at" # your matomo url
|
||||||
id = "" # your matomo id
|
id = "1" # your matomo id
|
||||||
|
|
||||||
|
|
||||||
# site verifications
|
# site verifications
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,8 @@
|
||||||
.stack{display:grid;gap:16px}
|
.stack{display:grid;gap:16px}
|
||||||
.stack-lg{display:grid;gap:24px}
|
.stack-lg{display:grid;gap:24px}
|
||||||
.info-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
|
.info-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
|
||||||
.info-item{display:flex;gap:.75rem;align-items:flex-start; justify-content:center; text-align:center}
|
.info-item{display:flex;gap:.75rem;align-items:flex-start}
|
||||||
.info-item .ico{flex:0 0 auto;line-height:0}
|
.info-item .ico{flex:0 0 auto;line-height:0;color:#F5A623}
|
||||||
.info-item .txt a{ text-decoration:none;color:inherit; }
|
|
||||||
|
|
||||||
/* CTA-Buttons & Socials: nutzt eure bestehenden Klassen – nur Layout-Hooks */
|
/* CTA-Buttons & Socials: nutzt eure bestehenden Klassen – nur Layout-Hooks */
|
||||||
.cta__actions{display:flex;gap:.75rem;flex-wrap:wrap}
|
.cta__actions{display:flex;gap:.75rem;flex-wrap:wrap}
|
||||||
|
|
@ -51,8 +50,8 @@
|
||||||
}
|
}
|
||||||
textarea.form-control{min-height:160px;resize:vertical}
|
textarea.form-control{min-height:160px;resize:vertical}
|
||||||
.form-control:focus{border-color:#F5A623;box-shadow:0 0 0 3px rgba(245,166,35,.18)}
|
.form-control:focus{border-color:#F5A623;box-shadow:0 0 0 3px rgba(245,166,35,.18)}
|
||||||
.form-legal{margin:0;opacity:.9}
|
.form-legal{margin:0;opacity:.9} /* p-Standardgröße bleibt erhalten */
|
||||||
.card h3{margin:0 0 .5rem}
|
.card h3{margin:0 0 .5rem} /* nur Abstand, Typo kommt global von h3 */
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<section class="contact-wrap">
|
<section class="contact-wrap">
|
||||||
|
|
@ -64,41 +63,34 @@
|
||||||
<div class="card card-pad stack-lg">
|
<div class="card card-pad stack-lg">
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
<h3>Kontakt</h3>
|
<h3>Kontakt</h3>
|
||||||
<ul class="info-list">
|
<ul class="info-list" style="display:grid;gap:12px;justify-items:center;text-align:center">
|
||||||
{{ with $addr }}
|
📍{{ with $addr }}
|
||||||
<li class="info-item">
|
<li class="info-item">
|
||||||
<span class="ico" aria-hidden="true">📍</span>
|
<div class="txt">{{ . | markdownify }}</div>
|
||||||
<div class="txt">{{ . | markdownify }}</div>
|
</li>
|
||||||
</li>
|
{{ end }}
|
||||||
{{ end }}
|
📧{{ with $email }}
|
||||||
|
<li class="info-item">
|
||||||
{{ with $email }}
|
<div class="txt">
|
||||||
<li class="info-item">
|
<a href="mailto:{{ . | safeURL }}" style="text-decoration:none;color:inherit;">{{ . }}</a>
|
||||||
<span class="ico" aria-hidden="true">📧</span>
|
</div>
|
||||||
<div class="txt">
|
</li>
|
||||||
<a href="mailto:{{ . | safeURL }}">{{ . }}</a>
|
{{ end }}
|
||||||
</div>
|
📞{{ with $phone1 }}
|
||||||
</li>
|
<li class="info-item">
|
||||||
{{ end }}
|
<div class="txt">
|
||||||
|
<a href="tel:{{ . | safeURL }}" style="text-decoration:none;color:inherit;">{{ . }}</a>
|
||||||
{{ with $phone1 }}
|
</div>
|
||||||
<li class="info-item">
|
</li>
|
||||||
<span class="ico" aria-hidden="true">📞</span>
|
{{ end }}
|
||||||
<div class="txt">
|
{{ with $phone2 }}
|
||||||
<a href="tel:{{ . | safeURL }}">{{ . }}</a>
|
<li class="info-item">
|
||||||
</div>
|
<div class="txt">
|
||||||
</li>
|
<a href="tel:{{ . | safeURL }}" style="text-decoration:none;color:inherit;">{{ . }}</a>
|
||||||
{{ end }}
|
</div>
|
||||||
|
</li>
|
||||||
{{ with $phone2 }}
|
{{ end }}
|
||||||
<li class="info-item">
|
</ul>
|
||||||
<span class="ico" aria-hidden="true">📱</span>
|
|
||||||
<div class="txt">
|
|
||||||
<a href="tel:{{ . | safeURL }}">{{ . }}</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="stack">
|
<div class="stack">
|
||||||
|
|
@ -120,7 +112,7 @@
|
||||||
|
|
||||||
<!-- ===== Formular ===== -->
|
<!-- ===== Formular ===== -->
|
||||||
<div class="col-lg-7" data-reveal>
|
<div class="col-lg-7" data-reveal>
|
||||||
<form method="POST" action="/send.php" class="card card-pad stack" novalidate>
|
<form method="POST" action="/send.php" class="card card-pad stack">
|
||||||
<div class="form-grid">
|
<div class="form-grid">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name" class="visually-hidden">Name</label>
|
<label for="name" class="visually-hidden">Name</label>
|
||||||
|
|
@ -146,25 +138,17 @@
|
||||||
<label for="message" class="visually-hidden">Ihre Nachricht</label>
|
<label for="message" class="visually-hidden">Ihre Nachricht</label>
|
||||||
<textarea id="message" name="message" class="form-control" rows="6" placeholder="Ihre Nachricht …" required></textarea>
|
<textarea id="message" name="message" class="form-control" rows="6" placeholder="Ihre Nachricht …" required></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- hCaptcha -->
|
||||||
<!-- hCaptcha – wird nach Consent via Tarteaucitron gerendert -->
|
|
||||||
<div class="form-group full">
|
<div class="form-group full">
|
||||||
<div class="h-captcha" data-sitekey="15a25108-bbc0-4d02-913c-4ada005ebd20" data-theme="dark"></div>
|
<div class="h-captcha" data-sitekey="15a25108-bbc0-4d02-913c-4ada005ebd20" data-theme="dark"></div>
|
||||||
<noscript>
|
|
||||||
<div style="color:#b00020;font-size:13px;margin-top:6px;">
|
|
||||||
Hinweis: Bitte aktivieren Sie JavaScript, um das Captcha zu laden.
|
|
||||||
</div>
|
|
||||||
</noscript>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="form-legal">
|
<p class="form-legal">
|
||||||
<label for="legal-consent">
|
<label for="legal-consent">
|
||||||
<input id="legal-consent" name="legal_consented" type="checkbox" required>
|
<input id="legal-consent" name="legal_consented" type="checkbox" required>
|
||||||
Ich bin mit der Verarbeitung meiner Daten zum Zweck der Kontaktaufnahme einverstanden. (Datenschutzhinweise beachten)
|
Ich bin mit der Verarbeitung meiner Daten zum Zweck der Kontaktaufnahme einverstanden. (Datenschutzhinweise beachten)
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<button class="cta__btn" type="submit" style="--btn-fs:1.5rem; --btn-py:14px; --btn-px:26px;">
|
<button class="cta__btn" type="submit" style="--btn-fs:1.5rem; --btn-py:14px; --btn-px:26px;">
|
||||||
<span aria-hidden="true">➜</span><span>Nachricht senden</span>
|
<span aria-hidden="true">➜</span><span>Nachricht senden</span>
|
||||||
|
|
@ -172,13 +156,28 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{/* Reveal Init (falls global nicht vorhanden) */}}
|
{{/* Reveal Init (falls global nicht vorhanden) */}}
|
||||||
<script>
|
<script>
|
||||||
|
(function(){
|
||||||
|
if (window.__contactRevealInit) return; window.__contactRevealInit = true;
|
||||||
|
var els = document.querySelectorAll("[data-reveal]");
|
||||||
|
if (!('IntersectionObserver' in window)){ els.forEach(e=>e.classList.add('is-visible')); return; }
|
||||||
|
var io = new IntersectionObserver(function(entries){
|
||||||
|
entries.forEach(function(entry){
|
||||||
|
if(entry.isIntersecting){
|
||||||
|
entry.target.classList.add('is-visible');
|
||||||
|
io.unobserve(entry.target);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, {threshold:.12});
|
||||||
|
els.forEach(e=>io.observe(e));
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<!-- hCaptcha-Skript -->
|
||||||
|
<script>
|
||||||
(function(){
|
(function(){
|
||||||
if (window.__contactRevealInit) return; window.__contactRevealInit = true;
|
if (window.__contactRevealInit) return; window.__contactRevealInit = true;
|
||||||
var els = document.querySelectorAll("[data-reveal]");
|
var els = document.querySelectorAll("[data-reveal]");
|
||||||
|
|
|
||||||
|
|
@ -75,3 +75,21 @@
|
||||||
<!-- Hugo SCSS Pipeline mit Template-Parsing -->
|
<!-- Hugo SCSS Pipeline mit Template-Parsing -->
|
||||||
{{- $scss := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | toCSS (dict "targetPath" "css/style.css") | minify -}}
|
{{- $scss := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | toCSS (dict "targetPath" "css/style.css") | minify -}}
|
||||||
<link rel="stylesheet" href="{{ $scss.RelPermalink }}">
|
<link rel="stylesheet" href="{{ $scss.RelPermalink }}">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Matomo -->
|
||||||
|
<script>
|
||||||
|
var _paq = window._paq = window._paq || [];
|
||||||
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
_paq.push(['enableLinkTracking']);
|
||||||
|
(function() {
|
||||||
|
var u="//matomo.amperion.at/";
|
||||||
|
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||||
|
_paq.push(['setSiteId', '1']);
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<!-- End Matomo Code -->
|
||||||
|
|
|
||||||
|
|
@ -131,11 +131,10 @@ tarteaucitron.init({
|
||||||
|
|
||||||
<!-- Matomo + hCaptcha in die Queue (NACH init) -->
|
<!-- Matomo + hCaptcha in die Queue (NACH init) -->
|
||||||
<script>
|
<script>
|
||||||
tarteaucitron.user.matomoId = 2;
|
|
||||||
tarteaucitron.user.matomoHost = 'https://matomo.amperion.at/';
|
|
||||||
tarteaucitron.user.matomoDontTrackPageView = false; // bei Bedarf true
|
|
||||||
tarteaucitron.user.matomoFullTracking = true; // bei Bedarf false
|
|
||||||
|
|
||||||
(tarteaucitron.job = tarteaucitron.job || []).push('matomocloud');
|
|
||||||
(tarteaucitron.job = tarteaucitron.job || []).push('hcaptcha');
|
(tarteaucitron.job = tarteaucitron.job || []).push('hcaptcha');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
tarteaucitron.user.matomoId = SITE_ID;
|
||||||
|
(tarteaucitron.job = tarteaucitron.job || []).push('matomo');
|
||||||
|
</script>
|
||||||
|
|
@ -1,19 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
// PHPMailer laden
|
// PHPMailer laden
|
||||||
require '/home/amperion-test/htdocs/test.amperion.at/vendor/phpmailer/src/PHPMailer.php';
|
require '/home/amperion/htdocs/www.amperion.at/vendor/phpmailer/src/PHPMailer.php';
|
||||||
require '/home/amperion-test/htdocs/test.amperion.at/vendor/phpmailer/src/SMTP.php';
|
require '/home/amperion/htdocs/www.amperion.at/vendor/phpmailer/src/SMTP.php';
|
||||||
require '/home/amperion-test/htdocs/test.amperion.at/vendor/phpmailer/src/Exception.php';
|
require '/home/amperion/htdocs/www.amperion.at/vendor/phpmailer/src/Exception.php';
|
||||||
|
|
||||||
use PHPMailer\PHPMailer\PHPMailer;
|
use PHPMailer\PHPMailer\PHPMailer;
|
||||||
use PHPMailer\PHPMailer\Exception;
|
use PHPMailer\PHPMailer\Exception;
|
||||||
|
|
||||||
// Fehler-Logging
|
// Fehler-Logging
|
||||||
ini_set('display_errors', 0);
|
ini_set('display_errors', 0);
|
||||||
ini_set('log_errors', 1);
|
ini_set('log_errors', 1);
|
||||||
ini_set('error_log', '/home/amperion-test/private/php_errors.log');
|
ini_set('error_log', '/home/amperion/private/php_errors.log');
|
||||||
|
|
||||||
// SMTP-Konfiguration laden
|
// SMTP-Konfiguration laden
|
||||||
$smtp_config = include '/home/amperion-test/private/smtp_config.php';
|
$smtp_config = include '/home/amperion/private/smtp_config.php';
|
||||||
|
|
||||||
|
// Prüfe, ob die Absenderadresse gültig ist
|
||||||
|
if (empty($smtp_config['smtp_from']) || !filter_var($smtp_config['smtp_from'], FILTER_VALIDATE_EMAIL)) {
|
||||||
|
error_log("Ungültige Absenderadresse in smtp_config.php: " . print_r($smtp_config, true));
|
||||||
|
echo "<p>Server-Konfigurationsfehler. Bitte später erneut versuchen.</p>";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Formulardaten abrufen
|
// Formulardaten abrufen
|
||||||
$name = $_POST["name"] ?? '';
|
$name = $_POST["name"] ?? '';
|
||||||
|
|
@ -42,19 +48,20 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, [
|
||||||
'remoteip' => $_SERVER['REMOTE_ADDR'] ?? null,
|
'remoteip' => $_SERVER['REMOTE_ADDR'] ?? null,
|
||||||
]);
|
]);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
$response = curl_exec($ch);
|
$response = curl_exec($ch);
|
||||||
if ($response === false) {
|
if ($response === false) {
|
||||||
error_log("cURL-Fehler bei hCaptcha: " . curl_error($ch));
|
error_log("cURL-Fehler bei hCaptcha: " . curl_error($ch));
|
||||||
|
echo "<p>Server-Fehler. Bitte später erneut versuchen.</p>";
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
$response_data = json_decode($response, true);
|
$response_data = json_decode($response, true);
|
||||||
|
|
||||||
// E-Mail mit PHPMailer senden, wenn Captcha ok
|
// E-Mail mit PHPMailer senden, wenn Captcha ok
|
||||||
if (!empty($response_data['success']) && $response_data['success'] === true) {
|
if (!empty($response_data['success']) && $response_data['success'] === true) {
|
||||||
$mail = new PHPMailer(true);
|
$mail = new PHPMailer(true);
|
||||||
try {
|
try {
|
||||||
|
$mail->SMTPDebug = 0; // Debug-Ausgabe deaktiviert
|
||||||
$mail->isSMTP();
|
$mail->isSMTP();
|
||||||
$mail->Host = $smtp_config['smtp_host'];
|
$mail->Host = $smtp_config['smtp_host'];
|
||||||
$mail->Port = $smtp_config['smtp_port'];
|
$mail->Port = $smtp_config['smtp_port'];
|
||||||
|
|
@ -62,17 +69,18 @@ if (!empty($response_data['success']) && $response_data['success'] === true) {
|
||||||
$mail->Username = $smtp_config['smtp_username'];
|
$mail->Username = $smtp_config['smtp_username'];
|
||||||
$mail->Password = $smtp_config['smtp_password'];
|
$mail->Password = $smtp_config['smtp_password'];
|
||||||
$mail->SMTPSecure = $smtp_config['smtp_encryption'];
|
$mail->SMTPSecure = $smtp_config['smtp_encryption'];
|
||||||
|
$mail->CharSet = 'UTF-8';
|
||||||
|
$mail->Encoding = 'base64';
|
||||||
|
|
||||||
|
// Absenderadresse prüfen
|
||||||
|
if (empty($smtp_config['smtp_from'])) {
|
||||||
|
throw new Exception("Absenderadresse nicht konfiguriert.");
|
||||||
|
}
|
||||||
$mail->setFrom($smtp_config['smtp_from'], $smtp_config['smtp_from_name']);
|
$mail->setFrom($smtp_config['smtp_from'], $smtp_config['smtp_from_name']);
|
||||||
$mail->addAddress('office@amperion.at'); // Empfänger
|
$mail->addAddress('office@amperion.at'); // Empfänger
|
||||||
if (!empty($email)) {
|
if (!empty($email)) {
|
||||||
$mail->addReplyTo($email, $name);
|
$mail->addReplyTo($email, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// UTF-8 für Betreff und Inhalt erzwingen
|
|
||||||
$mail->CharSet = 'UTF-8'; // <-- WICHTIG
|
|
||||||
$mail->Encoding = 'base64'; // <-- WICHTIG
|
|
||||||
|
|
||||||
$mail->Subject = mb_encode_mimeheader("Neue Kontaktanfrage: $subject", 'UTF-8');
|
$mail->Subject = mb_encode_mimeheader("Neue Kontaktanfrage: $subject", 'UTF-8');
|
||||||
$mail->Body = "
|
$mail->Body = "
|
||||||
Name: $name
|
Name: $name
|
||||||
|
|
@ -85,13 +93,14 @@ if (!empty($response_data['success']) && $response_data['success'] === true) {
|
||||||
";
|
";
|
||||||
|
|
||||||
$mail->send();
|
$mail->send();
|
||||||
header("Location: /danke/"); // Leitet zu /danke/index.html um
|
header("Location: /danke/");
|
||||||
exit();
|
exit();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
error_log("E-Mail-Fehler: " . $mail->ErrorInfo);
|
error_log("E-Mail-Fehler: " . $e->getMessage());
|
||||||
echo "<p>Es gab ein Problem beim Senden der Nachricht. Bitte versuche es später erneut.</p>";
|
echo "<p>Es gab ein Problem beim Senden der Nachricht. Bitte versuche es später erneut.</p>";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error_log("hCaptcha-Überprüfung fehlgeschlagen: " . print_r($response_data, true));
|
error_log("hCaptcha-Überprüfung fehlgeschlagen: " . print_r($response_data, true));
|
||||||
echo "<p>Bitte bestätige, dass du kein Roboter bist.</p>";
|
echo "<p>Bitte bestätige, dass du kein Roboter bist.</p>";
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,27 @@ AUTHOR WEBSITE: https://gethugothemes.com
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ partial "style.html" . }}
|
{{ partial "style.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
<!-- Matomo -->
|
||||||
|
<script>
|
||||||
|
var _paq = window._paq = window._paq || [];
|
||||||
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
_paq.push(['enableLinkTracking']);
|
||||||
|
(function() {
|
||||||
|
var u="//matomo.amperion.at/";
|
||||||
|
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||||
|
_paq.push(['setSiteId', '1']);
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<!-- End Matomo Code -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,13 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Baidu analytics -->
|
<!-- Baidu analytics -->
|
||||||
{{ if site.Params.baidu.enable }}
|
{{ if site.Params.baidu.enable }}
|
||||||
{{ with site.Params.baidu.analytics_id }}
|
{{ with site.Params.baidu.analytics_id }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue