-
Notifications
You must be signed in to change notification settings - Fork 32
feat: advanced email template #2397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
minottic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor comment. THanks!
f402743 to
110e43f
Compare
rkweehinzmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably I’m missing context, but when are these html snapshots used? looks OK to me - just in the various templates there're some dummy PIDs or JobIDs indicated, but I would instead find their variables like handlebars more useful, same also the updated statusCode word for finishing successfully or not.
|
@rkweehinzmann The snapshots are part of the unit tests. Anything that breaks the templating (eg if some fields were renamed) would hopefully cause a test failure due to the template output changing. They are deliberately checked in to git. As a side effect, the snapshots can also be useful when making your own template. In scicatlive you can modify the template and re-run ( |
Create a full-featured email job-template.html Use jest-file-snapshots for emailaction tests. This makes it easier to preview the template results
737e8e9 to
8b0e633
Compare
Can you give an example of what you mean? Or even better, add a suggested change in a review? |
Description
Adds a more advanced email template suitable for use with email job actions.
Motivation
The existing
job-template-simplified.htmlis too simple for real emails. This PR adds a "real" template to serve as a basis for facility-specific customization, as well as a suite of tests to check that the template is rendered properly.Details
This adds additional handlebar helpers:
or,and,not)concatfor string concatenationmatchesto test regular expressions (eg{{#if (matches job.statusCode "^finished")}})defaultconvenience helper for undefined variablesformatUnitfor unit conversions. This generalizes the v3formatBytehelper:{{formatUnit size "B" }}These are used in
job-template.html, which supports nicely-formatted emails for retrieve, archive, and public jobs.To use, add an email action to jobConfig.yaml, eg
When running in production mode (nginx), the job-template.html must be mounted into the container.
Fixes
Changes:
Tests included
Documentation
official documentation info