Hi all I've been trying to do something that I expected to be simple with RT: Send reminders to subscribers on a ticket *without* creating any comment or correspondence on the ticket. Send an email silently, in other words.
It turns out that much of RT::Action::SendEmail expects to have a current transaction and crashes ungracefully if there isn't one - it doesn't test to see if it gets a value for TransactionObj, but it fails at several points if the transaction is undef. It doesn't really seem to provide a way to tell it what group(s) you want notified except by examining the transaction either. I can write a completely separate action to do the job but I'll have to duplicate much of the code in RT::Action::SendEmail to do so, and that seems like a maintenance nightmare. The module isn't easily extended by a subclass in this way because many of the interesting bits are in the Prepare method anyway. How do others handle sending reminders and alerts, like SLA reminders? Do you just live with the annoying comment spam in tickets? Send mail directly, bypassing most of RT's mail handling code? I'm trying to find a way to reduce the amount of code duplication I need to do to send mail that's consistent with how RT expects other outbound mail to look - appropriate headers, etc. RT::Action::SendEmail::SendMessage(...) has the comment "TODO: Break this out to a separate module" in master and has had for a very long time. Willing to consider a patch that does so and tries to split RT::Action::SendEmail up into smaller, more easily wrapped/overridden methods too? -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services