Tags: Email, PDF, Report, Report Toaster, Slack
This task demonstrates how a report can be requested from Report Toaster as a PDF. Once delivered, it is emailed to one or more recipients and/or sent to a Slack channel.
- View in the task library: tasks.mechanic.dev/report-toaster-deliver-report-pdf-via-email-or-slack
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"report_id__required": null,
"email_report_recipients__array": null,
"slack_incoming_webhook_url": null,
"message_body__multiline_required": "Hello,\n\nYour report is now available for download:\n\nReport Name: {{ event.data.name }}\nDownload Link: {{ event.data.file.url }}\n\nEnjoy!",
"run_this_task_daily__boolean": null
}
Learn about task options in Mechanic
{% if options.run_this_task_daily__boolean %}
mechanic/scheduler/daily
{% endif %}
mechanic/user/trigger
report_toaster/reports/create
Learn about event subscriptions in Mechanic
This task demonstrates how a report can be requested from Report Toaster as a PDF. Once delivered, it is emailed to one or more recipients and/or sent to a Slack channel.
You can use this task with any pre-built or custom report from Report Toaster by simply changing the report ID. Learn how to find your report ID here.
The report can be requested via CSV or PDF by changing the file format property. If the file format is omitted, the report results are returned as JSON directly within the task result.
See Mechanic's documentation on Report Toaster for more information.
The task can be run manually, or optionally, set to run as a daily report by checking the "Run this task daily" option. If a less frequent schedule is desired, then you may substitute the "mechanic/scheduler/daily" subscription with a different scheduler topic. See the Mechanic scheduler event topics for more details.
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!