Send Notifications in Rails with Noticed gem v2 Discussion
The video talks about implementing a sort of escalated notification. Like send a slack web hook and then in 5 minutes send an email but not if the recipient already saw the slack web hook.
Is building block for this intended to be something like
config.unless = ->(recipient) {
self.read?
}
Because there will only be 1 notification no matter how many delivery methods. And the lambda passed to config.if or config.unless is evaluated in the context of the notification so it knows if it has been read?
Also, what is the best seam to use to test the config.if and config.unless logic? Is it to check for an enqueued job?
Chris, thanks for making Noticed. I've been using happily using it for a while now and am in the process of upgrading to v2. Any guidance on testing? These specs, for instance, fail:
expect { RsvpLastCallNotifier.with(event: @event).deliver(members) }.to change { ActionMailer::Base.deliveries.count }.by(1)
expect { RsvpLastCallNotifier.with(event: @event).deliver([@member]) }.to have_enqueued_job(ActionMailer::MailDeliveryJob)
Any notion of, say, deliver_now
? Appreciate everything you do. Thanks!
I'm a big fan of Noticed for building multi-channel notifications in Rails apps, so I wrote up this tutorial on building in-app notifications with Noticed and making them real-time with Turbo Streams.
If you haven't had a chance to experiment with Noticed yet, this should be a nice introduction to the gem, and to Turbo Streams and Frames, if you're interested in exploring the Turbo side of the Hotwire stack.
Hello,
is it possible to stop adding a record to the database if an error occurs in the email send method?
is this a substitute for public_activity gem? I was using public_activity for creating events and manually sending an email notification.
That sounds like a great tutorial! Combining Noticed with Turbo Streams for real-time notifications in Rails apps is a smart approach. It’ll be a valuable resource for anyone looking to enhance user experience with in-app messages and explore the Hotwire stack. I can’t wait to see it!