}
// Compose and deliver each child job
- $isComplete = $job->deliver($mailer, $testParams);
+ if (\CRM_Utils_Constant::value('CIVICRM_FLEXMAILER_HACK_DELIVER')) {
+ $isComplete = Civi\Core\Resolver::singleton()->call(CIVICRM_FLEXMAILER_HACK_DELIVER, array($job, $mailer, $testParams));
+ }
+ else {
+ $isComplete = $job->deliver($mailer, $testParams);
+ }
CRM_Utils_Hook::post('create', 'CRM_Mailing_DAO_Spool', $job->id, $isComplete);
* @param array $testParams
*/
public function deliver(&$mailer, $testParams = NULL) {
+ if (\Civi::settings()->get('experimentalFlexMailerEngine')) {
+ throw new \RuntimeException("Cannot use legacy deliver() when experimentalFlexMailerEngine is enabled");
+ }
+
$mailing = new CRM_Mailing_BAO_Mailing();
$mailing->id = $this->mailing_id;
$mailing->find(TRUE);
))->addTag('kernel.event_subscriber');
}
+ if (\CRM_Utils_Constant::value('CIVICRM_FLEXMAILER_HACK_SERVICES')) {
+ \Civi\Core\Resolver::singleton()->call(CIVICRM_FLEXMAILER_HACK_SERVICES, array($container));
+ }
+
\CRM_Utils_Hook::container($container);
return $container;
$dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, array('CRM_Event_ActionMapping', 'onRegisterActionMappings'));
$dispatcher->addListener(\Civi\ActionSchedule\Events::MAPPINGS, array('CRM_Member_ActionMapping', 'onRegisterActionMappings'));
+ if (\CRM_Utils_Constant::value('CIVICRM_FLEXMAILER_HACK_LISTENERS')) {
+ \Civi\Core\Resolver::singleton()->call(CIVICRM_FLEXMAILER_HACK_LISTENERS, array($dispatcher));
+ }
+
return $dispatcher;
}