Skip to content

Commit

Permalink
feat: invite by email from waitlist
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Aug 17, 2023
1 parent 392c165 commit 847b3fe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions app/Console/Commands/InviteFromWaitlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@ class InviteFromWaitlist extends Command
*
* @var string
*/
protected $signature = 'app:invite-from-waitlist';
protected $signature = 'app:invite-from-waitlist {email?}';

/**
* The console command description.
*
* @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.
*/
public function handle()
{
$this->next_patient = Waitlist::orderBy('created_at', 'asc')->where('verified', true)->first();
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();
}
if ($this->next_patient) {
$this->register_user();
$this->remove_from_waitlist();
Expand Down
2 changes: 1 addition & 1 deletion config/version.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

return '4.0.0-beta.20';
return '4.0.0-beta.21';
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.19"
"version": "4.0.0-beta.20"
}
}
}

0 comments on commit 847b3fe

Please sign in to comment.