Skip to content
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

Add support for custom e-mail formatting via Jinja templates #5

Open
jwodder opened this issue Nov 30, 2021 · 0 comments
Open

Add support for custom e-mail formatting via Jinja templates #5

jwodder opened this issue Nov 30, 2021 · 0 comments
Labels
configuration enhancement New feature or request therefor

Comments

@jwodder
Copy link
Owner

jwodder commented Nov 30, 2021

The config file should gain a subtable in which the user can specify Jinja templates for rendering each event type and the e-mail as a whole.

  • The event details should be present in an event template's context as an event: reponews.types.Event variable.
  • The template for the e-mail as a whole should be passed the events as an events: List[reponews.types.Event] variable, and each individual event is templated by calling a special render filter on it (not to be confused with Jinja's render() method; rethink name).
  • Strip trailing newlines from each template after rendering?
  • The templating subtable should have an environment_options (Rethink name) subtable giving parameters that will be passed directly to jinja2.Environment.
  • The templating subtable should have an html = BOOL key (default false) that, when set, causes reponews to use HTML instead of plain text templates as the default templates and also causes the final e-mail to be declared with Content-Type: text/html.
  • As in Add an option for dumping events as JSON #3, the "author" fields of events should be renamed to "user" first for consistency.
  • For consistency with other activity classes, NewForkEvent should gain a user property that just returns .fork.owner.
  • The templating subtable should include keys for controlling where included/imported templates should be loaded from.
@jwodder jwodder added the enhancement New feature or request therefor label Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration enhancement New feature or request therefor
Projects
None yet
Development

No branches or pull requests

1 participant