Send report result via mail regularly

LabKey Support Forum (Inactive)
Send report result via mail regularly alx dobre  2015-04-30 02:51
Status: Closed
 
Hello fellow developers :)

I have the following requirements to implement: do a query report and send the results via mail every day if and only if the data returned by the report changes.

I did the query report and it works properly. I reviewed the LK documentation and set myself up to be notified when that report changes (placed it in a category and managed notifications). The report is both visible and active.

Problem is, 24 hours later I have not received any notification. I know the server can send mails cause we can receive the user creation/update mails.

Here are my questions:
- Is this the right approach for the above requirements or would you implement it differently?
- can I manually test the sending of a report change digest mail? if so how?
- at what time each day is the 24 hour digest sent?
- where can I see a record of the e-mails sent by the system?
- is the digest triggered by changes in the data returned by the query report? or just a change in the report parameters?
- I saw that only a LK user can register to be notified by a report -> I need to register just an e-mail -> so can I achieve this via a custom JAVA module = run a report regularly and send the result via mail to a specific e-mail?


Thank you in advance for your time :)
 
 
Jon (LabKey DevOps) responded:  2015-05-05 00:31
Hi Alex,

Just to confirm, was this the documentation you followed?

https://www.labkey.org/wiki/home/Documentation/page.view?name=folderNotifications
https://www.labkey.org/wiki/home/Documentation/page.view?name=manageViews#notifications

My answers are below each question you asked:

- Is this the right approach for the above requirements or would you implement it differently?

Answer: This is the right way to do it if the instructions above are followed correctly. Please also note that the reports have to be visible and shared for the notifications to go out as well.

- can I manually test the sending of a report change digest mail? if so how?

Answer: You should be able to set the 15 minute digest to test the frequency and then do some updates.

- at what time each day is the 24 hour digest sent?

Answer: According to our documentation, it does say 24 hours, but I'll confirm whether it's an official 24 hours from the time things are set or if it is 24 hours from the time the server is started.

- where can I see a record of the e-mails sent by the system?

Answer: You should see this in the Audit Log under Admin > Site > Admin Console > Audit Log and select Message Events.

- is the digest triggered by changes in the data returned by the query report? or just a change in the report parameters?

Answer: The digest message should go out when the content of reports or datasets change occurs provided the report is both visible and shared.

- I saw that only a LK user can register to be notified by a report -> I need to register just an e-mail -> so can I achieve this via a custom JAVA module = run a report regularly and send the result via mail to a specific e-mail?

Answer: Yes, you could potentially build a custom Java module to run on its own mail sending rules. For more information on building a Java Module: https://www.labkey.org/wiki/home/Documentation/page.view?name=buildingModule

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2015-05-05 17:23
Hi Alex,

So regarding the 24 hour question, it's somewhat of a misnomer. The system is setup to send an email out at 12:05am every morning when you've configured the notifications on a daily basis.

Regards,

Jon
 
alx dobre responded:  2015-05-06 01:06
Thank you for getting back to me Jon,

I confirm that was the documentation I followed.

Your answers where very useful and I will review what I did and see which bit was missing cause it seems I was on the right path.

Since I wrote the first message I went ahead and implemented the report via e-mail using the JAVA remote API just running the query. This way I get full control on how the report is displayed.
 
adam responded:  2015-05-28 08:31
Not sure what version of LabKey Server the original poster was using, but note that we made a couple important fixes to the report/dataset notification feature in the 15.1 release. See https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=22445

Adam