Merge pull request 'Fix #15: Kontaktformular – mailto:-Integration für echte Anfragen' (#20) from feature/issue-15-kontaktformular-backend into main

Reviewed-on: #20
This commit is contained in:
2026-05-14 00:45:55 +02:00
2 changed files with 27 additions and 8 deletions

View File

@@ -527,7 +527,7 @@
<div class="form-success" id="formSuccess"> <div class="form-success" id="formSuccess">
<p>Vielen Dank für Ihre Anfrage!</p> <p>Vielen Dank für Ihre Anfrage!</p>
<br /> <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> </div>
<div class="contact-details"> <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) { $("#contactForm").on("submit", function (e) {
e.preventDefault(); e.preventDefault();
var btn = $(this).find(".btn-submit");
btn.text("Wird gesendet...").prop("disabled", true); var fname = $("#fname").val().trim();
setTimeout(function () { 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(); $("#contactForm").hide();
$("#formSuccess").fadeIn(400); $("#formSuccess").fadeIn(400);
}, 1200);
}); });
}); });