mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 00:44:18 -04:00
Implemented KIOSK_EMAIL environment variable. Lowered log output from unifi.js. Implemented kiosk email toggle. Fixed missing kiosk printer check causing errors. Updated README.md
This commit is contained in:
@@ -86,7 +86,7 @@ module.exports = {
|
||||
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
||||
error: req.flashMessage.type === 'error',
|
||||
error_text: req.flashMessage.message || '',
|
||||
email_enabled: variables.smtpFrom !== '' && variables.smtpHost !== '' && variables.smtpPort !== '',
|
||||
email_enabled: variables.kioskEmail && variables.smtpFrom !== '' && variables.smtpHost !== '' && variables.smtpPort !== '',
|
||||
unifiSsid: variables.unifiSsid,
|
||||
unifiSsidPassword: variables.unifiSsidPassword,
|
||||
qr: await qr(),
|
||||
@@ -142,10 +142,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Auto print voucher if enabled
|
||||
await print.escpos(voucherData, req.locale.language, variables.kioskPrinter).catch((e) => {
|
||||
log.error(`[Kiosk] Unable to auto-print voucher on printer: ${variables.kioskPrinter}!`);
|
||||
log.error(e);
|
||||
});
|
||||
if(variables.kioskPrinter !== '') {
|
||||
await print.escpos(voucherData, req.locale.language, variables.kioskPrinter).catch((e) => {
|
||||
log.error(`[Kiosk] Unable to auto-print voucher on printer: ${variables.kioskPrinter}!`);
|
||||
log.error(e);
|
||||
});
|
||||
}
|
||||
|
||||
res.render('kiosk', {
|
||||
t: translation('kiosk', req.locale.language),
|
||||
@@ -154,7 +156,7 @@ module.exports = {
|
||||
baseUrl: req.headers['x-ingress-path'] ? req.headers['x-ingress-path'] : '',
|
||||
error: req.flashMessage.type === 'error',
|
||||
error_text: req.flashMessage.message || '',
|
||||
email_enabled: variables.smtpFrom !== '' && variables.smtpHost !== '' && variables.smtpPort !== '',
|
||||
email_enabled: variables.kioskEmail && variables.smtpFrom !== '' && variables.smtpHost !== '' && variables.smtpPort !== '',
|
||||
unifiSsid: variables.unifiSsid,
|
||||
unifiSsidPassword: variables.unifiSsidPassword,
|
||||
qr: await qr(),
|
||||
|
||||
Reference in New Issue
Block a user