-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Ad hoc email command #12325
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far. Will verify in dev
return $builder; | ||
} | ||
|
||
private function builderFromNotifictionFamilies(array $notificationFamilies): Builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor typo - builderFromNotificationFamilies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
fix function name typo
($notifyAllUsers ? 1 : 0); | ||
|
||
if ($optionTypesCount != 1) { | ||
throw new \Error('Must filter users using exactly one of the option types'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can simply use InvalidArgumentException .. but your choice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right - that's more descriptive.
switch to InvalidArgumentException
$userCount = $users->count(); | ||
|
||
if ($this->confirm('Do you wish to send notifications to '.$userCount.' users?')) { | ||
$progressBar = $this->output->createProgressBar($userCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oo.. progressbar!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying out some of the new Laravel 11 features. 😉
Sorry for delaying on this what I noticed so far
testing few more things |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, when the template is mistakenly given it is failing silently
when there is multiple critieras given , I got different exception rather than the invalidargument .. but I'm not too worried about this .. as long as it breaks we know
But if the above one is fixed , would be great.
Also if we can have comma separated emails for bulk email would be great.
Other than that this looks awesome!
🤖 Resolves #11542
👋 Introduction
Adds an Artisan command and Laravel notification for sending ad hoc emails with just the first name and last name.
🕵️ Details
The command will select users to notify by one of three criteria:
🧪 Testing
./artisan send-notifications:ad-hoc-email cdaa82f1-7f76-4d9e-a82e-328c41a6ab62 0831e036-8dfb-4f5e-8b31-867b2c526d77 --emailAddress=email1@example.org --emailAddress=email2@example.org
./artisan send-notifications:ad-hoc-email cdaa82f1-7f76-4d9e-a82e-328c41a6ab62 0831e036-8dfb-4f5e-8b31-867b2c526d77 --notificationFamily=JOB_ALERT --notificationFamily=APPLICATION_UPDATE
./artisan send-notifications:ad-hoc-email cdaa82f1-7f76-4d9e-a82e-328c41a6ab62 0831e036-8dfb-4f5e-8b31-867b2c526d77 --notifyAllUsers
📸 Screenshot