/** * @param null $now * @param array $params * * @return array */ public static function processQueue($now = NULL, $params = array()) { $now = $now ? CRM_Utils_Time::setTime($now) : CRM_Utils_Time::getTime(); $mappings = CRM_Core_BAO_ActionSchedule::getMappings(); foreach ($mappings as $mappingID => $mapping) { CRM_Core_BAO_ActionSchedule::buildRecipientContacts($mappingID, $now, $params); CRM_Core_BAO_ActionSchedule::sendMailings($mappingID, $now); } $result = array('is_error' => 0, 'messages' => ts('Sent all scheduled reminders successfully')); return $result; }