CRM-13244 - CRM_Core_BAO_ActionSchedule - Simplify `sendReminder`
authorTim Otten <totten@civicrm.org>
Fri, 24 Jul 2015 02:18:22 +0000 (19:18 -0700)
committerTim Otten <totten@civicrm.org>
Sun, 27 Sep 2015 01:53:43 +0000 (21:53 -0400)
commit43ceab3f7541e855228e2cf3ae91304bed9dea86
treed94fa6ebaf5120a9fe1c29a71f6429b77cabdb0b
parent8adcd0735bc955721841ac7f04a3e3bc13ebb252
CRM-13244 - CRM_Core_BAO_ActionSchedule - Simplify `sendReminder`

The old `sendReminder()` had too many responsibilities (loading token data
and processing token data and sending emails and sending SMS's), contained
lots of duplicate code, and did pointless variable shuffling.  The Smarty
and HTML parameters were enforced inconsistently, and the "From" address had
weird side-effects, ad nauseum.

This commit splits `sendReminder()` into three pieces:
 * `TokenCompatSubscriber` for filling in token data.
 * `sendReminderSms()` for sending SMS.
 * `sendReminderEmail()` for sending email.
CRM/Core/BAO/ActionSchedule.php
CRM/Utils/Token.php
Civi/Core/Container.php
Civi/Token/TokenCompatSubscriber.php [new file with mode: 0644]
tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php