mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve initial email flow
This commit is contained in:
parent
948e44263e
commit
835f9b49ce
@ -36,6 +36,7 @@ use Illuminate\Support\Facades\Cache;
|
|||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Turbo124\Beacon\Facades\LightLogs;
|
use Turbo124\Beacon\Facades\LightLogs;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
|
||||||
class CreateAccount
|
class CreateAccount
|
||||||
{
|
{
|
||||||
@ -114,8 +115,22 @@ class CreateAccount
|
|||||||
|
|
||||||
$spaa9f78->fresh();
|
$spaa9f78->fresh();
|
||||||
|
|
||||||
if(Ninja::isHosted())
|
if(Ninja::isHosted()){
|
||||||
|
nlog("welcome");
|
||||||
|
App::forgetInstance('translator');
|
||||||
|
$t = app('translator');
|
||||||
|
$t->replace(Ninja::transformTranslations($sp035a66->settings));
|
||||||
|
|
||||||
|
$nmo = new NinjaMailerObject;
|
||||||
|
$nmo->mailable = new \Modules\Admin\Mail\Welcome($sp035a66->owner());
|
||||||
|
$nmo->company = $sp035a66;
|
||||||
|
$nmo->settings = $sp035a66->settings;
|
||||||
|
$nmo->to_user = $sp035a66->owner();
|
||||||
|
|
||||||
|
NinjaMailerJob::dispatch($nmo);
|
||||||
|
|
||||||
\Modules\Admin\Jobs\Account\NinjaUser::dispatch([], $sp035a66);
|
\Modules\Admin\Jobs\Account\NinjaUser::dispatch([], $sp035a66);
|
||||||
|
}
|
||||||
|
|
||||||
VersionCheck::dispatch();
|
VersionCheck::dispatch();
|
||||||
|
|
||||||
@ -123,6 +138,9 @@ class CreateAccount
|
|||||||
->increment()
|
->increment()
|
||||||
->batch();
|
->batch();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $sp794f3f;
|
return $sp794f3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,6 @@ class CreateUser
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
if(!Ninja::isSelfHost()) {
|
if(!Ninja::isSelfHost()) {
|
||||||
nlog("in the create user class");
|
|
||||||
event(new UserWasCreated($user, $user, $this->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new UserWasCreated($user, $user, $this->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
|||||||
use Illuminate\Foundation\Events\Dispatchable;
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class SendVerificationNotification implements ShouldQueue
|
class SendVerificationNotification implements ShouldQueue
|
||||||
{
|
{
|
||||||
@ -53,6 +54,9 @@ class SendVerificationNotification implements ShouldQueue
|
|||||||
|
|
||||||
$event->user->service()->invite($event->company);
|
$event->user->service()->invite($event->company);
|
||||||
|
|
||||||
|
|
||||||
|
if(Carbon::parse($event->company->created_at)->lt(now()->subDay()))
|
||||||
|
{
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
$t = app('translator');
|
$t = app('translator');
|
||||||
$t->replace(Ninja::transformTranslations($event->company->settings));
|
$t->replace(Ninja::transformTranslations($event->company->settings));
|
||||||
@ -63,7 +67,7 @@ class SendVerificationNotification implements ShouldQueue
|
|||||||
$nmo->settings = $event->company->settings;
|
$nmo->settings = $event->company->settings;
|
||||||
$nmo->to_user = $event->creating_user;
|
$nmo->to_user = $event->creating_user;
|
||||||
NinjaMailerJob::dispatch($nmo);
|
NinjaMailerJob::dispatch($nmo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user