feat: server-wide default quarantine notification settings + modern notification template#7307
Open
discostur wants to merge 3 commits into
Open
feat: server-wide default quarantine notification settings + modern notification template#7307discostur wants to merge 3 commits into
discostur wants to merge 3 commits into
Conversation
…emplate Add an admin-configurable, server-wide default for the quarantine notification interval and category. Previously these two per-mailbox settings could only fall back to compile-time values in vars.inc.php and there was no way to set a default from the UI or apply one to existing mailboxes. - Store defaults in Redis (Q_DEF_NOTIFICATION, Q_DEF_CATEGORY) via the existing quarantine settings handler, alongside the other Q_* keys. - New mailboxes inherit the global default through a new get_quarantine_default() helper (Redis -> vars.inc.php fallback). Per-mailbox user overrides keep working unchanged. - New admin action "apply_existing" force-applies the default to all existing mailboxes (admin only, confirm dialog in the UI). - Add two dropdowns and an apply button to the admin quarantine settings tab plus the corresponding language strings. - Rewrite the notification email template (data/assets/templates/ quarantine.tpl) as a clean, mobile-first, responsive, dark-mode aware layout. All Jinja2 variables, HTML escaping and qhandler links are preserved; only installs with an empty custom template are affected. No DB schema change, no migration, no Docker image rebuild.
Make the default notification email look more professional and less playful by removing the bright-green chrome: - Header: solid green bar -> white header with dark slate title and a subtle bottom divider, merged flush with the body as one card. - Primary action button (release / send copy): green -> dark slate, with a lighter-slate dark-mode override. Semantic status badges (rejected = red, junk = amber) and all Jinja2 variables, escaping, qhandler links, dark-mode and mobile rules are unchanged.
|
Interesting enhancement, especially for the template which could do with some modernization. What does it look like now? Would be nice to see screenshots on desktop and mobile screens. |
Replace the outlined delete button with a clean filled light-grey button (dark slate text) so it visually matches the filled "Release to inbox" button while staying clearly secondary. Dark-mode override added.
Author
|
@apio-sys made some example screenshots, one from desktop (sogo) and one from my iphone:
|
Author
|
Is anyone from the maintainers going to review this? |
Author
|
@milkmaker may someone from the team review this please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Contribution Guidelines
What does this PR include?
Short Description
This PR adds a server-wide default for the two quarantine notification settings and modernizes the notification email template.
Until now,
quarantine_notification(never / hourly / daily / weekly) andquarantine_category(rejected / junk / all) could only be configured per mailbox. New mailboxes fell back to hardcoded values invars.inc.php, and there was no way for an admin to define a default from the UI or to push a default onto already existing mailboxes.What's new:
Q_DEF_NOTIFICATION,Q_DEF_CATEGORY) via the existing quarantine settings handler, exactly like the otherQ_*quarantine settings.get_quarantine_default()helper (Redis →vars.inc.phpfallback). Per-mailbox user overrides keep working unchanged.apply_existing, behind a confirm dialog) force-applies the current default to all existing mailboxes viaJSON_SET.data/assets/templates/quarantine.tpl): clean, mobile-first responsive layout (stacked cards, tap-friendly action buttons), dark-mode aware, hidden preheader. All Jinja2 variables, HTML escaping (|e) andqhandlerrelease/delete links are preserved. Only installs with an empty custom template (Q_HTML) are affected — existing custom templates are left untouched.No DB schema change, no migration, no Docker image rebuild (web changes are PHP/Twig/lang; the template is a volume-mounted asset).
Affected Containers
No container needs to be rebuilt. The changed code runs in existing images:
quarantine.tpl)Did you run tests?
What did you tested?
php -lon both changed PHP files (no syntax errors).quarantine.tplwith Jinja2SandboxedEnvironment(same engine asquarantine_notify.py) for counter = 1 / many andquarantine_acl= 0 / 1: verified singular/plural text, HTML-escaped subjects, correct release vs. "send copy" wording, and that release/delete links are omitted when the recipient has no quarantine ACL.lang.en-gb.jsonstays valid JSON.What were the final results? (Awaited, got)