user invitation send mail control method changes..
This commit is contained in:
parent
a69e1f470d
commit
5277d77c0a
@ -19,7 +19,7 @@ class CreateUser extends Job implements HasOwner, HasSource, ShouldCreate
|
|||||||
event(new UserCreating($this->request));
|
event(new UserCreating($this->request));
|
||||||
|
|
||||||
\DB::transaction(function () {
|
\DB::transaction(function () {
|
||||||
if (! app()->runningInConsole() && ! request()->isInstall()) {
|
if (empty($this->request->get('password', false))) {
|
||||||
$this->request->merge(['password' => Str::random(40)]);
|
$this->request->merge(['password' => Str::random(40)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ class CreateUser extends Job implements HasOwner, HasSource, ShouldCreate
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((! app()->runningInConsole() && ! request()->isInstall()) || app()->runningUnitTests()) {
|
if ($this->shouldSendInvitation()) {
|
||||||
$this->dispatch(new CreateInvitation($this->model));
|
$this->dispatch(new CreateInvitation($this->model));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -80,4 +80,17 @@ class CreateUser extends Job implements HasOwner, HasSource, ShouldCreate
|
|||||||
|
|
||||||
return $this->model;
|
return $this->model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function shouldSendInvitation()
|
||||||
|
{
|
||||||
|
if (app()->runningInConsole()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request()->isInstall()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user