feat: invite by email from waitlist
This commit is contained in:
parent
392c1650db
commit
847b3fe54f
@ -19,21 +19,29 @@ class InviteFromWaitlist extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'app:invite-from-waitlist';
|
protected $signature = 'app:invite-from-waitlist {email?}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Send invitation to the next user in the waitlist';
|
protected $description = 'Send invitation to the next user (or by email) in the waitlist';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
if ($this->argument('email')) {
|
||||||
|
$this->next_patient = Waitlist::where('email', $this->argument('email'))->first();
|
||||||
|
if (!$this->next_patient) {
|
||||||
|
$this->error("{$this->argument('email')} not found in the waitlist.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$this->next_patient = Waitlist::orderBy('created_at', 'asc')->where('verified', true)->first();
|
$this->next_patient = Waitlist::orderBy('created_at', 'asc')->where('verified', true)->first();
|
||||||
|
}
|
||||||
if ($this->next_patient) {
|
if ($this->next_patient) {
|
||||||
$this->register_user();
|
$this->register_user();
|
||||||
$this->remove_from_waitlist();
|
$this->remove_from_waitlist();
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.20';
|
return '4.0.0-beta.21';
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"version": "3.12.36"
|
"version": "3.12.36"
|
||||||
},
|
},
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.19"
|
"version": "4.0.0-beta.20"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user