We're posting a flag to a table. The table has an "event" field. When we post the value "email" into that field, a sweeper app that runs on a schedule looks for this flag, then takes the value in the message field and sends that out as an email.
Personally I'd have your trigger put the necessary data into a queue to run the report then have some other process take that data off asynchronously. Either pop it in a table and do it yourself or use a robust distributed broker protocol platform like RabbitMQ or Apache ActiveMQ or Kafka.
Tim Clarke MBCS IT Director Direct: +44 (0)1376 504510 | Mobile: +44 (0)7887 563420
On 08/05/2020 17:26, David Gauthier wrote:
psql (9.6.0, server 11.3) on linux
Looking for ideas. I want a trigger to...
1) compose an html report based on DB content
2) email the report to a dist list (dl = value of a table column)
If this will involve hybrid coding, I prefer PL/perl. The linux env has both "mail" and "mutt" (if this is of any help).
The idea is to send a report to the list when all the data has been collected for a particular job and the final status of the job is updated as a col of a rec of a certain table. Probably a post update trigger.
Minerva Analytics Ltd - A Solactive Company 9 Freebournes Court | Newland Street | Witham | Essex | CM8 2BL | United Kingdom
Copyright: This e-mail may contain confidential or legally privileged information. If you are not the named addressee you must not use or disclose such information, instead please report it to admin@minerva.info Legal: Minerva Analytics is the trading name of: Minerva Analytics Ltd: Registered in England Number 11260966 & The Manifest Voting Agency Ltd: Registered in England Number 2920820 Registered Office at above address. Please Click Here https://www.manifest.co.uk/legal/ for further information.