Skip to content

Commit

Permalink
Hide email button when mail function is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
glenndehaan committed Aug 17, 2024
1 parent c5cc756 commit de07e51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ if(webService) {
error_text: req.flashMessage.message || '',
timeConvert: time,
bytesConvert: bytes,
email_enabled: smtpFrom !== '' && smtpHost !== '' && smtpPort !== '',
voucher_types: voucherTypes,
voucher_custom: voucherCustom,
vouchers: cache.vouchers,
Expand Down
2 changes: 1 addition & 1 deletion template/voucher.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
<path d="M10.5 10.5a5.23 5.23 0 0 0-1.279-3.434 9.768 9.768 0 0 1 6.963 6.963 5.23 5.23 0 0 0-3.434-1.279h-1.875a.375.375 0 0 1-.375-.375V10.5Z" />
</svg>
</button>
<button type="button" data-id="<%= voucher._id %>" class="voucher-email relative rounded-full p-1 text-gray-500 dark:text-gray-400 hover:text-black dark:hover:text-white">
<button type="button" data-id="<%= voucher._id %>" class="voucher-email relative rounded-full p-1 text-gray-500 dark:text-gray-400 hover:text-black dark:hover:text-white<%= !email_enabled ? ' hidden' : '' %>">
<span class="absolute -inset-1.5"></span>
<span class="sr-only">Email Voucher Code</span>
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
Expand Down

0 comments on commit de07e51

Please sign in to comment.