|
|
@@ -27,13 +27,10 @@ class SubdomainService
|
|
|
// Validation regex for subdomains
|
|
|
const RX_VALIDATE_SUBDOMAIN = '/^[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?$/';
|
|
|
|
|
|
- const ADMIN_2IOS_ID = 10984;
|
|
|
-
|
|
|
public function __construct(
|
|
|
private readonly SubdomainRepository $subdomainRepository,
|
|
|
private readonly EntityManagerInterface $em,
|
|
|
private readonly MessageBusInterface $messageBus,
|
|
|
- private readonly Security $security,
|
|
|
private readonly OrganizationUtils $organizationUtils,
|
|
|
private readonly BindFileService $bindFileService,
|
|
|
private readonly AccessRepository $accessRepository
|
|
|
@@ -192,13 +189,10 @@ class SubdomainService
|
|
|
* @return SubdomainChangeModel
|
|
|
*/
|
|
|
protected function getMailModel(Subdomain $subdomain): SubdomainChangeModel {
|
|
|
- /** @var Access $access */
|
|
|
- $access = $this->security->getUser();
|
|
|
-
|
|
|
- $senderId = $access ? $access->getId() : self::ADMIN_2IOS_ID;
|
|
|
+ $adminAccess = $this->accessRepository->findAdminAccess($subdomain->getOrganization());
|
|
|
|
|
|
return (new SubdomainChangeModel())
|
|
|
- ->setSenderId($senderId)
|
|
|
+ ->setSenderId($adminAccess->getId())
|
|
|
->setOrganizationId($subdomain->getOrganization()->getId())
|
|
|
->setSubdomainId($subdomain->getId())
|
|
|
->setUrl($this->organizationUtils->getOrganizationWebsite($subdomain->getOrganization()));
|