feat: edit notification templates from the admin UI - #744
Merged
Merged
Conversation
- Application page: edit the templates of the application folder (notifications/<application id>/), including the ones inherited from the fallback folder; Settings page: edit Agate's own templates. - Edited templates are saved in AGATE_HOME/conf/templates/notifications/ and override the bundled ones; reverting deletes the override. - FreeMarker syntax highlighting (Ace) and server-side HTML preview of the unsaved content, rendered in a sandboxed iframe. - Templates are validated before saving; folder and name are whitelisted against path traversal. - FreeMarker hardening: new_builtin_class_resolver=safer, api_builtin_enabled=false.
ymarcon
added a commit
that referenced
this pull request
Oct 3, 2026
* feat: edit notification templates from the admin UI (#743) - Application page: edit the templates of the application folder (notifications/<application id>/), including the ones inherited from the fallback folder; Settings page: edit Agate's own templates. - Edited templates are saved in AGATE_HOME/conf/templates/notifications/ and override the bundled ones; reverting deletes the override. - FreeMarker syntax highlighting (Ace) and server-side HTML preview of the unsaved content, rendered in a sandboxed iframe. - Templates are validated before saving; folder and name are whitelisted against path traversal. - FreeMarker hardening: new_builtin_class_resolver=safer, api_builtin_enabled=false. * feat: notification template preview language selector (#743) * feat: notification templates table actions on row hover, as in other tables (#743)
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.
Closes #743
Summary
notifications/<application id>/, the name applications authenticate with when sending emails), plus the ones inherited from the fallback folder. The fallback folder is also shown in the properties list.notifications/*.ftl).AGATE_HOME/conf/templates/notifications/; reverting/removing deletes the file so the bundled/inherited one applies again. FreeMarker template cache is cleared on change.REST
/config/notification-templates(agate-administrator),?folder=(none: Agate's own):GETlist,GET|PUT|DELETE /{name},POST /{name}/_previewSecurity
new_builtin_class_resolver: safer,api_builtin_enabled: false(no bundled template uses?new/?api).Deployment note
AGATE_HOME/confmust be writable by the agate user (otherwise saving returns a 500 with the IO error).Tests
NotificationTemplateServiceTest: write/list/revert, inherited templates, Agate's own templates, invalid template, preview, path traversal.