id) || empty($item->type)) continue; $targetId = $item->id; $targetType = $item->type; $target = $this->getEntityManager()->getEntity($targetType, $targetId); if (!$target) continue; if (!$this->getAcl()->check($target, 'read')) { continue; } $targetList[] = $target; } $massEmail = $this->getEntityManager()->getEntity('MassEmail', $id); if (!$massEmail) { throw new NotFound(); } if (!$this->getAcl()->check($massEmail, 'read')) { throw new Forbidden(); } $this->getRecordService()->createQueue($massEmail, true, $targetList); $this->getRecordService()->processSending($massEmail, true); return true; } }