'unsubscribe',
'optout',
'opened',
+ 'total_opened',
'bounce',
'spool',
);
// CRM-1258
$row['opened'] = CRM_Mailing_Event_BAO_Opened::getTotalCount($mailing_id, $mailing->id, TRUE);
$report['event_totals']['opened'] += $row['opened'];
+ $row['total_opened'] = CRM_Mailing_Event_BAO_Opened::getTotalCount($mailing_id, $mailing->id);
+ $report['event_totals']['total_opened'] += $row['total_opened'];
// compute unsub total separately to discount duplicates
// CRM-1783
// CRM-8460
$gotCronLock = FALSE;
- if (property_exists($config, 'mailerJobsMax') && $config->mailerJobsMax && $config->mailerJobsMax > 0) {
- $lockArray = range(1, $config->mailerJobsMax);
+ $mailerJobsMax = Civi::settings()->get('mailerJobsMax');
+ if (is_numeric($mailerJobsMax) && $mailerJobsMax > 0) {
+ $lockArray = range(1, $mailerJobsMax);
shuffle($lockArray);
// check if we are using global locks
foreach ($lockArray as $lockID) {
- $cronLock = Civi\Core\Container::singleton()->get('lockManager')->acquire("worker.mailing.send.{$lockID}");
+ $cronLock = Civi::lockManager()->acquire("worker.mailing.send.{$lockID}");
if ($cronLock->isAcquired()) {
$gotCronLock = TRUE;
break;
// load bootstrap to call hooks
// Split up the parent jobs into multiple child jobs
- $mailerJobSize = (property_exists($config, 'mailerJobSize')) ? $config->mailerJobSize : NULL;
+ $mailerJobSize = Civi::settings()->get('mailerJobSize');
CRM_Mailing_BAO_MailingJob::runJobs_pre($mailerJobSize, $mode);
CRM_Mailing_BAO_MailingJob::runJobs(NULL, $mode);
CRM_Mailing_BAO_MailingJob::runJobs_post($mode);