Bug 16149 - Generate and send custom notices based on report output
Summary: Generate and send custom notices based on report output
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL: http://devs.bywatersolutions.com/proj...
Whiteboard:
Keywords:
: 15507 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-03-28 13:40 UTC by Nicole C. Engard
Modified: 2017-05-12 21:14 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 16149 - Generate and send custom notices based on report output (8.45 KB, patch)
2017-04-17 15:24 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16149 - Generate and send custom notices based on report output (9.26 KB, patch)
2017-05-12 21:14 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 16149 - Unit tests (3.89 KB, patch)
2017-05-12 21:14 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2016-03-28 13:40:37 UTC
Work to be done: Write a cron script that will
a) Accept parameters for
1) a report id
2) a notice code
3) a notice module
4a) a branchcode
4b) or database column from which to select the branchcode
5) a column from which to select the email address to send to ( if not set, Koha will use the first available email address for the patron )
6a) A "from" email address
6b) A column from which to select the "from" email address
b) The script will run the report and for each row of results will generate a notice and queue it for sending. All and only the columns from the report will be available to be used in the notice text.

Looking for sponsors: http://devs.bywatersolutions.com/projects/custom-notices-based-report-output/
Comment 1 Nicole C. Engard 2016-06-01 18:03:35 UTC
*** Bug 15507 has been marked as a duplicate of this bug. ***
Comment 2 Nick Clemens 2017-04-17 15:24:38 UTC
Created attachment 62217 [details] [review]
Bug 16149 - Generate and send custom notices based on report output

Ths patch add an EmailReport function to C4::Reports::Guided

It accepts a notice (module, code, branch) and a report and attempts to
email notices to patron, generating content using report content.

Notice must be in template toolkit syntax, only columns in report are
available for notice.

To test:
1 - Specify various options
2 - Ensure errors are returned if options are incomplete or incorrect
3 - Pass a report containing 'from' and 'email' and 'borrowernumber'
columns and ensure message queue populated as expected
Comment 3 Nick Clemens 2017-05-12 21:14:41 UTC
Created attachment 63454 [details] [review]
Bug 16149 - Generate and send custom notices based on report output

Ths patch add an EmailReport function to C4::Reports::Guided

It accepts a notice (module, code, branch) and a report and attempts to
email notices to patron, generating content using report content.

Notice must be in template toolkit syntax, only columns in report are
available for notice.

To test:
1 - Specify various options
2 - Ensure errors are returned if options are incomplete or incorrect
3 - Pass a report containing 'from' and 'email' and 'borrowernumber'
columns and ensure message queue populated as expected
Comment 4 Nick Clemens 2017-05-12 21:14:45 UTC
Created attachment 63455 [details] [review]
Bug 16149 - Unit tests

To test:
prove -v t/db_dependent/Reports/Guided.t