diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index d145fdc8e2a1..882604331bab 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -23,6 +23,7 @@ use App\Jobs\Mail\NinjaMailerObject; use App\Jobs\User\CreateUser; use App\Jobs\Util\VersionCheck; use App\Mail\Admin\AccountCreatedObject; +use App\Mail\Admin\VerifyUserObject; use App\Models\Account; use App\Notifications\Ninja\NewAccountCreated; use App\Utils\Ninja; @@ -95,12 +96,21 @@ class CreateAccount //todo implement SLACK notifications //$sp035a66->notification(new NewAccountCreated($spaa9f78, $sp035a66))->ninja(); + // $nmo = new NinjaMailerObject; + // $nmo->mailable = new NinjaMailer((new AccountCreatedObject($spaa9f78, $sp035a66))->build()); + // $nmo->company = $sp035a66; + // $nmo->to_user = $spaa9f78; + // $nmo->settings = $sp035a66->settings; + $nmo = new NinjaMailerObject; - $nmo->mailable = new NinjaMailer((new AccountCreatedObject($spaa9f78, $sp035a66))->build()); + $nmo->mailable = new NinjaMailer((new VerifyUserObject($spaa9f78, $sp035a66))->build()); $nmo->company = $sp035a66; $nmo->to_user = $spaa9f78; $nmo->settings = $sp035a66->settings; + NinjaMailerJob::dispatch($nmo); + + NinjaMailerJob::dispatchNow($nmo); VersionCheck::dispatchNow(); diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 49878080f8c2..742a4769576c 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -77,6 +77,7 @@ class AccountTransformer extends EntityTransformer 'debug_enabled' => (bool) config('ninja.debug_enabled'), 'is_docker' => (bool) config('ninja.is_docker'), 'is_scheduler_running' => (bool) $account->is_scheduler_running, + 'default_company_id' => (string) $this->encodePrimaryKey($account->default_company_id), ]; }