Skip to content

Commit 075d35e

Browse files
committed
Fix: Assign default messaging tier to new accounts
1 parent b80c7ab commit 075d35e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/app/Services/Application/Handlers/Account/CreateAccountHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function handle(CreateAccountDTO $accountData): AccountDomainObject
6666
'short_id' => IdHelper::shortId(IdHelper::ACCOUNT_PREFIX),
6767
'account_verified_at' => $isSaasMode ? null : now()->toDateTimeString(),
6868
'account_configuration_id' => $this->getAccountConfigurationId($accountData),
69+
'account_messaging_tier_id' => $this->getDefaultMessagingTierId(),
6970
]);
7071

7172
$user = $this->getExistingUser($accountData) ?? $this->userRepository->create([
@@ -258,4 +259,10 @@ private function isInternalReferrer(?string $referrer): bool
258259

259260
return $appHost === $referrerHost;
260261
}
262+
263+
private function getDefaultMessagingTierId(): int
264+
{
265+
// Self-hosted instances get Premium tier, SaaS gets Untrusted
266+
return $this->config->get('app.is_hi_events') ? 1 : 3;
267+
}
261268
}

0 commit comments

Comments
 (0)