It would be nice for testing and migration purposes if we could run process_message_queue.pl but have the emails go to a testing address instead of the patron's email address, and have SMS messages go to a testing phone number instead of the patron's sms number.
Created attachment 48222 [details] [review] Bug 15857 - Add test mode to process_message_queue.pl It would be nice for testing and migration purposes if we could run process_message_queue.pl but have the emails go to a testing address instead of the patron's email address, and have SMS messages go to a testing phone number instead of the patron's sms number. Test Plan: 1) Apply this patch 2) Add some stuff to the message queue however you wish 3) Run process_message_queue.pl with the addition parameters --test --test-email your@email.com 4) Note that you recieve those emails, and not the address listed in the message_queue table! 5) Bonus points: If you have an SMS service, repeat the test with SMS notices and --test-sms
With patch applied, I get (with and without test mode): "state" variable @_ masks earlier declaration in same scope at /usr/share/kohaclone/C4/Letters.pm line 1282. "my" variable $message masks earlier declaration in same scope at /usr/share/kohaclone/C4/Letters.pm line 1298. syntax error at /usr/share/kohaclone/C4/Letters.pm line 1237, near ") if" syntax error at /usr/share/kohaclone/C4/Letters.pm line 1246, near "}" Global symbol "$message" requires explicit package name at /usr/share/kohaclone/C4/Letters.pm line 1250. syntax error at /usr/share/kohaclone/C4/Letters.pm line 1256, near "}" Can't use global @_ in "my" at /usr/share/kohaclone/C4/Letters.pm line 1261, near "= @_" syntax error at /usr/share/kohaclone/C4/Letters.pm line 1279, near "}" (Might be a runaway multi-line << string starting on line 1265) Can't use global @_ in "my" at /usr/share/kohaclone/C4/Letters.pm line 1282, near "= @_" syntax error at /usr/share/kohaclone/C4/Letters.pm line 1295, near "}" syntax error at /usr/share/kohaclone/C4/Letters.pm line 1344, near "}" Can't use global @_ in "my" at /usr/share/kohaclone/C4/Letters.pm line 1347, near "= @_" /usr/share/kohaclone/C4/Letters.pm has too many errors. Compilation failed in require at misc/cronjobs/process_message_queue.pl line 28. BEGIN failed--compilation aborted at misc/cronjobs/process_message_queue.pl line 28.
Could you hashref that huge parameter list while you are at it?
Created attachment 49114 [details] [review] Bug 15857 - Add test mode to process_message_queue.pl It would be nice for testing and migration purposes if we could run process_message_queue.pl but have the emails go to a testing address instead of the patron's email address, and have SMS messages go to a testing phone number instead of the patron's sms number. Test Plan: 1) Apply this patch 2) Add some stuff to the message queue however you wish 3) Run process_message_queue.pl with the addition parameters --test --test-email your@email.com 4) Note that you recieve those emails, and not the address listed in the message_queue table! 5) Bonus points: If you have an SMS service, repeat the test with SMS notices and --test-sms
(In reply to M. Tompsett from comment #3) > Could you hashref that huge parameter list while you are at it? Fixed! Could you specify which sub's parameter list you are referring to?
_send_message_by_email( $message, $params ) and _send_message_by_sms( $message, $params ) rather than exploding individual params.
Kyle does Srdjan's comment require a follow-up, or is this still 'Needs Signoff?'
I believe that bug 8000 added the test mode intended here. *** This bug has been marked as a duplicate of bug 8000 ***