split languages in order-mail to support and customer
All checks were successful
Build and Deploy Hugo Site / buildAndDeploy (push) Successful in 1m0s

This commit is contained in:
bettina 2024-06-27 07:36:30 +02:00
commit 360f65fe91
5 changed files with 30 additions and 23 deletions

View file

@ -15,7 +15,7 @@ mb_internal_encoding("UTF-8");
try {
// Receive and validate input data using filter_input()
$name = strip_tags(trim(filter_input(INPUT_POST, 'name') . ' ' . filter_input(INPUT_POST, 'vorname'))); // Add filter_input(INPUT_POST, 'nachname') to $name
$lang = $lang = ( isset($_POST['sprache']) && $_POST['sprache'] == "FR" ? "FR" : "DE" );
$email = filter_var(trim(filter_input(INPUT_POST, 'email')), FILTER_SANITIZE_EMAIL);
$subject = strip_tags(trim(filter_input(INPUT_POST, 'formularart')));
// Construct the message using the function from message.php
@ -24,7 +24,7 @@ try {
// Invalid input
throw new Exception('Ungültige Eingabedaten.');
}
// TODO SMTP von Verua verwenden
// SMTP von Verua verwenden
// Server settings
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable this for detailed debugging
$mail->isSMTP(); // Use SMTP
@ -41,7 +41,7 @@ try {
// $mail->addBCC('ah@mediendesign-hnida.de'); // Add bounce email address as BCC
$mail->addBCC('rabe@verua.swiss'); // Add bounce email address as BCC
// Content
// Content Mail to support
$mail->isHTML(true); // Email in HTML format
$mail->CharSet = 'UTF-8';
$encodedSubject = mb_encode_mimeheader($subject, "UTF-8", "Q");
@ -57,10 +57,10 @@ try {
// Send a second email to the customer
$customerEmail = $email;
$customerSubject = 'Danke für Ihre Bestellung bei der VeruA AG';
$customerSubject = ($lang == "DE" ? 'Danke für Ihre Bestellung bei der VeruA AG' : 'Merci pour votre commande chez VeruA AG' );
$encodedSubject = mb_encode_mimeheader($customerSubject, "UTF-8", "Q");
$customerMessage = constructCustomerMessageDE($message);
$customerMessage = constructCustomerMessage($message);
$mail->clearAddresses();
$mail->addAddress($customerEmail);