entityManager->getEntityById(EmailTemplate::ENTITY_TYPE, $emailTemplateId); if (!$emailTemplate) { throw new NotFound(); } $params ??= Params::create() ->withApplyAcl(true) ->withCopyAttachments(true); if ( $params->applyAcl() && !$this->acl->checkEntityRead($emailTemplate) ) { throw new ForbiddenSilent(); } if (!$data->getUser()) { $data = $data->withUser($this->user); } return $this->processor->process($emailTemplate, $params, $data); } }