Fix #15: Kontaktformular – mailto:-Integration für echte Anfragen #20

Merged
greggy merged 1 commits from feature/issue-15-kontaktformular-backend into main 2026-05-14 00:45:56 +02:00
2 changed files with 27 additions and 8 deletions

View File

@@ -527,7 +527,7 @@
<div class="form-success" id="formSuccess">
<p>Vielen Dank für Ihre Anfrage!</p>
<br />
<small>Wir melden uns schnellstmöglich bei Ihnen.</small>
<small>Ihr E-Mail-Programm wurde geöffnet. Bitte senden Sie die E-Mail ab, damit Ihre Anfrage bei uns eingeht.</small>
</div>
</div>
<div class="contact-details">

View File

@@ -71,14 +71,33 @@ $(function () {
}
});
// Form submit
// Form submit opens email client with pre-filled mailto: link
$("#contactForm").on("submit", function (e) {
e.preventDefault();
var btn = $(this).find(".btn-submit");
btn.text("Wird gesendet...").prop("disabled", true);
setTimeout(function () {
$("#contactForm").hide();
$("#formSuccess").fadeIn(400);
}, 1200);
var fname = $("#fname").val().trim();
var lname = $("#lname").val().trim();
var email = $("#email").val().trim();
var phone = $("#phone").val().trim();
var interest = $("#interest").val();
var message = $("#message").val().trim();
var subject = "Kontaktanfrage: " + interest;
var body = "Von: " + fname + " " + lname + "\n";
body += "E-Mail: " + email + "\n";
if (phone) body += "Telefon: " + phone + "\n";
body += "Anliegen: " + interest + "\n\n";
body += message;
var mailto =
"mailto:mki@kies-media.de" +
"?subject=" + encodeURIComponent(subject) +
"&body=" + encodeURIComponent(body);
window.location.href = mailto;
// Show success message
$("#contactForm").hide();
$("#formSuccess").fadeIn(400);
});
});