Skip to content

Is there a way to automatically email a document (like a Supplier Return) to a supplier when a specific action happens, instead of a user manually using RMB > Print and selecting an email option each time?

Answer

Rather than building this from scratch with a custom event that generates the report and constructs the email itself (a much more involved undertaking, requiring you to find and call into the report-generation packages directly), the simpler and more maintainable approach is to trigger off the report actually being printed: use the standard PDF_REPORT_CREATED application event, and on its E-Mail action, add a condition matching REPORT_TITLE to the specific report you're targeting. The main remaining piece is populating the correct recipient email address into the PDF_PARAMETER_1 value — typically resolved via Comm_Method_API against the relevant party's default email/address setup — so that when the report is actually printed/generated (through the normal flow), the matching event action automatically emails it out, rather than reimplementing report generation and mail-sending yourself.

← Browse Reporting and analytics questions