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]
|
||||
enable = false
|
||||
url = "" # your matomo url
|
||||
id = "" # your matomo id
|
||||
enable = true
|
||||
url = "https://matomo.amperion.at" # your matomo url
|
||||
id = "1" # your matomo id
|
||||
|
||||
|
||||
# site verifications
|
||||
|
|
|
|||
|
|
@ -30,9 +30,8 @@
|
|||
.stack{display:grid;gap:16px}
|
||||
.stack-lg{display:grid;gap:24px}
|
||||
.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 .ico{flex:0 0 auto;line-height:0}
|
||||
.info-item .txt a{ text-decoration:none;color:inherit; }
|
||||
.info-item{display:flex;gap:.75rem;align-items:flex-start}
|
||||
.info-item .ico{flex:0 0 auto;line-height:0;color:#F5A623}
|
||||
|
||||
/* CTA-Buttons & Socials: nutzt eure bestehenden Klassen – nur Layout-Hooks */
|
||||
.cta__actions{display:flex;gap:.75rem;flex-wrap:wrap}
|
||||
|
|
@ -51,8 +50,8 @@
|
|||
}
|
||||
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-legal{margin:0;opacity:.9}
|
||||
.card h3{margin:0 0 .5rem}
|
||||
.form-legal{margin:0;opacity:.9} /* p-Standardgröße bleibt erhalten */
|
||||
.card h3{margin:0 0 .5rem} /* nur Abstand, Typo kommt global von h3 */
|
||||
</style>
|
||||
|
||||
<section class="contact-wrap">
|
||||
|
|
@ -64,41 +63,34 @@
|
|||
<div class="card card-pad stack-lg">
|
||||
<div class="stack">
|
||||
<h3>Kontakt</h3>
|
||||
<ul class="info-list">
|
||||
{{ with $addr }}
|
||||
<li class="info-item">
|
||||
<span class="ico" aria-hidden="true">📍</span>
|
||||
<div class="txt">{{ . | markdownify }}</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ with $email }}
|
||||
<li class="info-item">
|
||||
<span class="ico" aria-hidden="true">📧</span>
|
||||
<div class="txt">
|
||||
<a href="mailto:{{ . | safeURL }}">{{ . }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ with $phone1 }}
|
||||
<li class="info-item">
|
||||
<span class="ico" aria-hidden="true">📞</span>
|
||||
<div class="txt">
|
||||
<a href="tel:{{ . | safeURL }}">{{ . }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ with $phone2 }}
|
||||
<li class="info-item">
|
||||
<span class="ico" aria-hidden="true">📱</span>
|
||||
<div class="txt">
|
||||
<a href="tel:{{ . | safeURL }}">{{ . }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<ul class="info-list" style="display:grid;gap:12px;justify-items:center;text-align:center">
|
||||
📍{{ with $addr }}
|
||||
<li class="info-item">
|
||||
<div class="txt">{{ . | markdownify }}</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
📧{{ with $email }}
|
||||
<li class="info-item">
|
||||
<div class="txt">
|
||||
<a href="mailto:{{ . | safeURL }}" style="text-decoration:none;color:inherit;">{{ . }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
📞{{ with $phone1 }}
|
||||
<li class="info-item">
|
||||
<div class="txt">
|
||||
<a href="tel:{{ . | safeURL }}" style="text-decoration:none;color:inherit;">{{ . }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ with $phone2 }}
|
||||
<li class="info-item">
|
||||
<div class="txt">
|
||||
<a href="tel:{{ . | safeURL }}" style="text-decoration:none;color:inherit;">{{ . }}</a>
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="stack">
|
||||
|
|
@ -120,7 +112,7 @@
|
|||
|
||||
<!-- ===== Formular ===== -->
|
||||
<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-group">
|
||||
<label for="name" class="visually-hidden">Name</label>
|
||||
|
|
@ -146,25 +138,17 @@
|
|||
<label for="message" class="visually-hidden">Ihre Nachricht</label>
|
||||
<textarea id="message" name="message" class="form-control" rows="6" placeholder="Ihre Nachricht …" required></textarea>
|
||||
</div>
|
||||
|
||||
<!-- hCaptcha – wird nach Consent via Tarteaucitron gerendert -->
|
||||
<!-- hCaptcha -->
|
||||
<div class="form-group full">
|
||||
<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>
|
||||
|
||||
<p class="form-legal">
|
||||
<label for="legal-consent">
|
||||
<input id="legal-consent" name="legal_consented" type="checkbox" required>
|
||||
Ich bin mit der Verarbeitung meiner Daten zum Zweck der Kontaktaufnahme einverstanden. (Datenschutzhinweise beachten)
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<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>
|
||||
|
|
@ -172,13 +156,28 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{/* Reveal Init (falls global nicht vorhanden) */}}
|
||||
<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(){
|
||||
if (window.__contactRevealInit) return; window.__contactRevealInit = true;
|
||||
var els = document.querySelectorAll("[data-reveal]");
|
||||
|
|
|
|||
|
|
@ -75,3 +75,21 @@
|
|||
<!-- Hugo SCSS Pipeline mit Template-Parsing -->
|
||||
{{- $scss := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | toCSS (dict "targetPath" "css/style.css") | minify -}}
|
||||
<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) -->
|
||||
<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');
|
||||
</script>
|
||||
|
||||
<script>
|
||||
tarteaucitron.user.matomoId = SITE_ID;
|
||||
(tarteaucitron.job = tarteaucitron.job || []).push('matomo');
|
||||
</script>
|
||||
|
|
@ -1,19 +1,25 @@
|
|||
<?php
|
||||
// PHPMailer laden
|
||||
require '/home/amperion-test/htdocs/test.amperion.at/vendor/phpmailer/src/PHPMailer.php';
|
||||
require '/home/amperion-test/htdocs/test.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/PHPMailer.php';
|
||||
require '/home/amperion/htdocs/www.amperion.at/vendor/phpmailer/src/SMTP.php';
|
||||
require '/home/amperion/htdocs/www.amperion.at/vendor/phpmailer/src/Exception.php';
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
// Fehler-Logging
|
||||
ini_set('display_errors', 0);
|
||||
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_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
|
||||
$name = $_POST["name"] ?? '';
|
||||
|
|
@ -42,19 +48,20 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, [
|
|||
'remoteip' => $_SERVER['REMOTE_ADDR'] ?? null,
|
||||
]);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
if ($response === false) {
|
||||
error_log("cURL-Fehler bei hCaptcha: " . curl_error($ch));
|
||||
echo "<p>Server-Fehler. Bitte später erneut versuchen.</p>";
|
||||
exit;
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
$response_data = json_decode($response, true);
|
||||
|
||||
// E-Mail mit PHPMailer senden, wenn Captcha ok
|
||||
if (!empty($response_data['success']) && $response_data['success'] === true) {
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
$mail->SMTPDebug = 0; // Debug-Ausgabe deaktiviert
|
||||
$mail->isSMTP();
|
||||
$mail->Host = $smtp_config['smtp_host'];
|
||||
$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->Password = $smtp_config['smtp_password'];
|
||||
$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->addAddress('office@amperion.at'); // Empfänger
|
||||
if (!empty($email)) {
|
||||
$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->Body = "
|
||||
Name: $name
|
||||
|
|
@ -85,13 +93,14 @@ if (!empty($response_data['success']) && $response_data['success'] === true) {
|
|||
";
|
||||
|
||||
$mail->send();
|
||||
header("Location: /danke/"); // Leitet zu /danke/index.html um
|
||||
header("Location: /danke/");
|
||||
exit();
|
||||
} 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>";
|
||||
}
|
||||
} else {
|
||||
error_log("hCaptcha-Überprüfung fehlgeschlagen: " . print_r($response_data, true));
|
||||
echo "<p>Bitte bestätige, dass du kein Roboter bist.</p>";
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,27 @@ AUTHOR WEBSITE: https://gethugothemes.com
|
|||
{{ else }}
|
||||
{{ partial "style.html" . }}
|
||||
{{ 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>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -147,6 +147,13 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Baidu analytics -->
|
||||
{{ if site.Params.baidu.enable }}
|
||||
{{ with site.Params.baidu.analytics_id }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue