Skip to content
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

Internal/batch notifications #168

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

demogorgonzola
Copy link
Contributor

@demogorgonzola demogorgonzola commented Jul 9, 2019

Fixes #165

A way to compress notifications to single email so we don't annoy the hell out of the volunteers.

Still needs a few comments and probably should move the logic from the command to a job that is queueable.

+ comments on tests and the new job
@demogorgonzola
Copy link
Contributor Author

Split it into a job and we're set to go!

Tell me if there's any formatting, commenting, etc. that you'd like me to improve on!

@jcam
Copy link

jcam commented Jul 30, 2019

Two quick questions!

What features does this PR add?
#40 might refer to (either directly or indirectly):

  • admin or dept lead can send email messages to everyone signed up for a department
  • admin or dept lead can send email to one participant
  • system automatically notifies a user of a shift when signing up
  • system automatically notifies a user of all of their shifts N days before the event
  • system automatically notifies a dept lead when participant signs up (immediately or batched)
  • system can automatically send 'here's what it means to be a greeter' for example, to all who signed up to greet, N days before the event
  • shift reminders (1 hour? 15 minute? 1 day?) sent via email
  • reminders (1 hour? 15 minute? 1 day?) sent via text

How ready is this? I have an event starting shift signup in 2 weeks, and notifications would be nice :)

@demogorgonzola
Copy link
Contributor Author

Hey @jcam!

Currently, the PR only notifies people if they've been signed up for a shift or multiple shifts. We're turning the rest of the batchable emails into notifications so they can be crunched into a singular daily email (if they have notifications).

These all look like amazing features and look to pertain to #40, which I mistakenly wrote in the PR. My bad!

@jcam
Copy link

jcam commented Aug 8, 2019

Ah! Okay, I'll get less excited then :D

Copy link
Contributor

@Meleeman01 Meleeman01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a few errors that need checked there's code in the slot controller that allows banned users to sign up, simple update to the conditional should work, and I ran the notifications:send command manually, and i got a wierd lil error telling me my shift started from a date to a time.

@@ -53,6 +53,10 @@ private function userAllowed(Slot $slot)
$allowed = true;
}
}
if($slotRoles->isEmpty())
{
$allowed = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows for banned users to take shifts.

*/
public function handle($event)
{
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this listener created? i don't see anything being handled just yet.

Schema::create('notifications', function (Blueprint $table)
{
$table->increments('id');
$table->enum('type', ['info', 'warning', 'email']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while enums are more efficient, strings are better cause we could have more info types in the future, and changing migrations is not easy to deal with.


@foreach($notification_metadata as $metadata)
@include('emails.'.$metadata['layout'], $metadata)
<br>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to manually run this and I got a wierd result, it looks like its putting the date of when it starts as the start time
`

Daily Reminder about your shifts!

Thank you for being a part of Your Volunteer Database. Here's your daily dump of some weird stuff.

<h1>You're signed up for the Vice President Of Human Resources shift!</h1>

This is a confirmation email for the Vice President Of Human Resources shift you recently picked up for the Vice President Of Human Resources event.

This shift takes place on 2019-09-05 between the times of 2019-09-05 and 09:00:00.

If you did NOT sign-up for this shift or would like to CANCEL this shift, click here.

Otherwise, we look forward to seeing you there!


If any of these look strange, please log into your account and review your shifts.

`

~ ScheduleFactory and UserFactory to come with "volunteer"  role
~ view now displays start_time
~ Notifications migration no longer user enums, just strings
Copy link
Contributor

@Meleeman01 Meleeman01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything seems to be working as intended, and you fixed the seeder even as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch notifications
3 participants