KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Automatic Emailing of PDF reports #3044

Open Bruce Lewin opened this topic on on May 9, 2023 - 3 comments

Bruce Lewin commented on May 9, 2023

I'm looking at installing KoolReports but before I do, I wanted to ask how easy it will be to automatically email people a PDF report who have completed a survey?

The thread below implies this is possible...

https://www.koolreport.com/forum/topics/475

The workflow will be

Survey completion > New row in a MySQL DB > Kool Reports to make a PDF > PDF get's emailed to the person who completed the survey

Is this possible please?

Sebastian Morales commented on May 11, 2023

Yes, this is doable. Pls check our demo for pdf export:

https://www.koolreport.com/examples/reports/export/sakila_rental/

In the file "export.php" below the page, you can add a row to your database, export and save the exported pdf file using saveAs function and then call an email function to attach that file:

...
addRowToMySQL();

$report->run()
->export(...)
...
->saveAs("tmp/report.pdf");
sendEmailWithAttachment("tmp/report.pdf"); 
Bruce Lewin commented on May 15, 2023

Great... and can KoolReports run a report automatically as well? So the workflow becomes...

  • Survey completion
  • New row in a MySQL DB
  • Automatically, Kool Reports makes a PDF
  • PDF get's emailed to the person who completed the survey
KoolReport commented on May 16, 2023

Yes, above pseudo code will create pdf right after row is added to db and then email to user

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None