bpuig / laravel-subby

Laravel Plan and Subscriptions manager.
https://bpuig.github.io/laravel-subby
MIT License
102 stars 42 forks source link

Email notifications about expiring subscriptions #73

Closed boryn closed 3 years ago

boryn commented 3 years ago

Hi! I was wondering about a scheduler for email notifications about expiring subscriptions. Thereotically the mechanim should not be that complicated.

I would see a config with time before end divided per subscription tag: ['main']['sub'] => [7, 3, 1] //days before subscription ends

or even expressed in hours so that we can send an email 4 or 1 hour before the end. ['primary']['trial'] => [72, 24, 4, 1]

Scheduler would pick up subscribers (in the loop according to the config) and send a notification with 'mail' channel given as an example. If someone would like to use some other like sms / web push, they'd need to override the base notification method:

Notification::send(
    $subscribers,
    new ExpiringSubscriptionNotification(
    //
    )
);
bpuig commented 3 years ago

It's a good idea. But notifications are not as simple as they seem, they can be more complex, like using services (like email relays), channels, etc. keeping track of who has been notified, etc It has to be deeply thought

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.