Persist locale between kiosk voucher generation and email send page. Also ensure locale is used as language when sending the email from the kiosk page

This commit is contained in:
Glenn de Haan
2025-07-07 21:48:24 +02:00
parent 69c86d1172
commit 5a59c93e2c
2 changed files with 2 additions and 2 deletions

View File

@@ -179,7 +179,7 @@ if(variables.serviceWeb) {
});
if(voucher) {
const emailResult = await mail.send(req.body.email, voucher).catch((e) => {
const emailResult = await mail.send(req.body.email, voucher, req.locale.language).catch((e) => {
res.cookie('flashMessage', JSON.stringify({type: 'error', message: e}), {httpOnly: true, expires: new Date(Date.now() + 24 * 60 * 60 * 1000)}).redirect(302, `${req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : ''}/kiosk`);
});

View File

@@ -132,7 +132,7 @@
</div>
<% if(email_enabled) { %>
<form class="grid gap-4" id="email-form" action="<%= baseUrl %>/kiosk" method="post" enctype="multipart/form-data">
<form class="grid gap-4" id="email-form" action="<%= baseUrl %>/kiosk?locale=<%= language %>-<%= language %>" method="post" enctype="multipart/form-data">
<% if(typeof email === 'undefined') { %>
<div class="space-y-2">
<label for="email" class="block text-sm font-medium text-gray-700 dark:text-gray-300">