getQueryParam('id'); if ($id === null) { throw new BadRequest("No `id`."); } $data = Data::create() ->withRelatedType($request->getQueryParam('relatedType')) ->withRelatedId($request->getQueryParam('relatedId')) ->withParentType($request->getQueryParam('parentType')) ->withParentId($request->getQueryParam('parentId')) ->withEmailAddress($request->getQueryParam('emailAddress')); $result = $this->getEmailTemplateService()->process($id, $data); return $result->getValueMap(); } private function getEmailTemplateService(): Service { return $this->injectableFactory->create(Service::class); } }