Hello all, looking for a bit of insight into a subscription based script, although not a payment type subscription. I am talking about forum subscriptions, where after a post, users subscribed would receive an email instantly, an hour later, or at the end of the day.
I would imagine this would be a cron type of job, but I have never messed with cron jobs and really don't have a great idea of how to go about this the best way ( as in not having to write more code than I have to ).
I thought I would create a subscription table, and after a post, check who was subscribed to that thread. If they are, insert them into this new table. Instant notification users would be emailed immediatly rather than entered, while an hour later or end of day users would be entered into the table and cron would run accordingly.
Would this be an ideal way to go about planning for such a thing? Sorry, just don't have experience in this general area.
I would think it might be more efficient to add a single column to your posts table, 'subscribed' or what have you, and store a serialized array in said column of subscribed user IDs. Then when a new post is submitted, trigger a callback which will run against this array and fire off the necessary emails.