[Bug 36504] New: Run report should have an option to only send the attachment
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 Bug ID: 36504 Summary: Run report should have an option to only send the attachment Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Currently, if runreport sends results via email, they are included in the body when also supplied as an attachment. Some libraries would like to receive only the attachment, to make the email less cluttered for large reports. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 164385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164385&action=edit Bug 36504: Add attach_only option to run report To test: 1 - Create a report in Koha 2 - Have koha setup to send emails 3 - perl misc/cronjobs/runreport.pl --to="example@example.org" --subject="Report cronjob" --format=csv --csv-header -a 1 4 - Note the email body and attachment contain the results 5 - Apply this patch 6 - Repeat above 7 - Note the email body says "Repost results attached" 8 - Confirm results attached 9 - Adjust report to have 0 results 10 - perl misc/cronjobs/runreport.pl --to="example@example.org" --subject="Report cronjob" --format=csv --csv-header -a 1 --send_empty 11 - Confirm the attachment exists, but message body indicates no results -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 164386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164386&action=edit Bug 36504: Add a test-email option This is not necessarily for pushing, but makes testing first patch easier as it doesn't require setting up email. Apply this patch, and add --test-email when runnign the script. The email object will be dumped to the screen and you can verofy the content of the body/attachment -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #3 from David Nind <david@davidnind.com> --- I only used the first patch, and set up KTD to use email [1]. Using the new -ao option when the report has results: no message in the body, attachment is called 'noname' (using just -a is called 'report1-YYYY-MM-DD.csv') Using the new -ao option when the report has no results: "No results were returned for the report" in the body and the attachment called 'report1-YYYY-MM-DD.csv'. So, I think this isn't working as intended when the report has results - there should be a message in the body ("Report results attached") and the report attached should be correctly named. Full details ============ After applying the patch, if I use the -ao (or --attach_only) option: 1. The email body is empty. 2. The attached file is called 'noname'. 3. Using just -a (before and after the patch is applied), the attachment is called 'report1-YYYY-MM-DD.csv'. 4. If the report is empty (using -a or -ao) I get a message with "No results were returned for the report" in the body and the attachment called 'report1-YYYY-MM-DD.csv'. [1] To test sending emails using a Google account: 1. Set up an App password for your Google Account 2. Edit /etc/koha/sites/kohadev/koha-conf.xml file and add this configuration near the end (where <user_name> = your Google email address; <password> = your APP password, not your Google account password): <smtp_server> <host>smtp.gmail.com</host> <port>587</port> <timeout>5</timeout> <ssl_mode>STARTTLS</ssl_mode> <user_name>GOOGLEACCOUNTUSER</user_name> <password>GOOGLEAPPPASSWORD</password> <debug>1</debug> </smtp_server> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- I tested again, I couldn't get email working but the dumped email looks correct to me, could you test again? And maybe send the emails to my email so I see the problem ;-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36504 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- (In reply to David Nind from comment #3)
Using the new -ao option when the report has results: no message in the body, attachment is called 'noname' (using just -a is called 'report1-YYYY-MM-DD.csv')
Confirmed.
Using the new -ao option when the report has no results: "No results were returned for the report" in the body and the attachment called 'report1-YYYY-MM-DD.csv'.
In my test the screen output is "NO OUTPUT: 0 results from execute_query" and there is no email. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org