mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 08:53:53 -04:00
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:
@@ -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`);
|
||||
});
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user