mirror of
https://github.com/postgres/pgweb.git
synced 2025-07-25 16:02:27 +00:00

When a news article is approved, it gets delivered as an email to the pgsql-announce mailinglist. It will render the markdown of the news article into a HTML part of the email, and include the markdown raw as the text part (for those unable or unwilling to read html mail). For each organisation, a mail template can be specified. Initially only two templates are supported, one "default" and one "pgproject" which is for official project news. The intention is *not* to provide generic templates, but we may want to extend this to certain related projects in the future *maybe* (such as regional NPOs). These templates are stored in templates/news/mail/*.html, and for each template *all* images found in templates/news/mail/img.<template>/ will be attached to the email. "Conditional image inclusion" currently not supported. To do CSS inlining on top of the markdown output, module pynliner is now required (available in the python3-pynliner package on Debian). A testing script is added as news_send_email.py in order to easier test out templates. This is *not* intended for production sending, so it will for example send unmoderated news. By sending, it adds it to the outgoing mailqueue in the system, so unless the cronjob is set up to send, nothing will happen until that is run manually. Support is included for tagged delivery using pglister, by directly mapping NewsTags to pglister tags. While at it, update the moderation preview forms to preview news items using the HTML template for the email (while leaving other types of items previewing without a particular stylesheet).