palkan / active_delivery

Ruby framework for keeping all types of notifications (mailers, push notifications, whatever) in one place

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notify_later with parameters to schedule it

benebrice opened this issue · comments

Is your feature request related to a problem? Please describe.

Schedule a delivery like action mailer

Describe the solution you'd like

MyDelivery.with(user: u).notify(:something, {wait_until: 1.minute.from_now})

Describe alternatives you've considered

I'm wondering if it's currently possible or not. I did not find any clue on the documentation. From the code I've read, it seams possible but not found the correct way to write it. @palkan I'm pretty sure you know everything about this subject. Could you light this up? 😁

Currently, it's not possible. I think, we can add support for it using the following API:

MyDelivery.with(user: u).something.deliver_later(wait_until: 1.minute.from_now)

And then we can pass #delivery_later arguments down the road to the corresponding #notify_later calls and background execution adapters.

Not sure, how to accomplish this using the legacy interface (notify(event, args...)).

I honestly think it will be painful with legacy interface. Update on #notify_later seems good. I'll make some tries. 🙂

Released in 1.1.0