imacrayon / snowbodyknows

A secret santa wishlist builder
https://snowbodyknows.com
10 stars 6 forks source link

Notification management #42

Open imacrayon opened 11 months ago

imacrayon commented 11 months ago

The app now sends emails when wishes are added to a wishlist and when comments are posted to a wishlist. There should probably be an area where users can customize what kinds of email notifications they want to receive.

sebcar commented 10 months ago

Hi! Is someone working on this?

sebcar commented 9 months ago

Hi! Sorry for the delay.

image

Is this ok in the profile update page?

imacrayon commented 9 months ago

Awesome, that looks great!

sebcar commented 9 months ago

It is ok to have a Configuration Model with id, value, user_id to manage different configuration options in the future?

imacrayon commented 9 months ago

Sure, I think that’s fine. I wouldn’t be opposed to using a JSON column either. Whatever you prefer is cool.

sebcar commented 9 months ago

A JSON column sounds good, so it will be something like user_id, value(json)

imacrayon commented 9 months ago

Sorry, I meant a JSON column on the users table called settings or something. Instead of making a whole new table. If you’ve got a lot of ideas for setting though, maybe a separate table would be the way to go?

sebcar commented 8 months ago

I'm going for a settings column in users :)

sebcar commented 8 months ago

Everything working except the notification test image Cannot change the settings value for the $viewer

imacrayon commented 8 months ago

I would double check that you have WishCreatedNotification imported in your test, sometimes I forget to do that. If that's not the cause try doing:

Notification::assertNotSentTo($viewer, WishCreatedNotification::class);

See if that passes. I've has issues with using a closure with assertNotSentTo in the past.

imacrayon commented 8 months ago

Line 29 in WishController is kind of hard to follow. It might be easier to read if you used filter instead of reject:

Notification::send($withlist->viewers->filter(fn ($viewer) => $viewer->settings['notification']['wish-created']), ...);
sebcar commented 8 months ago

Ok, let's fix that