This question has also been posted on Stack Overflow.
I have an design/architecture and documentation/reference question for Drupal 9.5.
Suppose I'm building a custom calendar. I have a new Contet Type, call it PublicEvent. It has fields field_date and field_n_notifies (default 1).
On every cron run, I want to collect all PublicEvent where field_n_notifies > 0 and (1) send a message to the author's email with the event's title as the subject, and (2) decrement field_n_notifies by 1.
This way I'd have basic email reminders on a calendar. I've looked at Rules module but it doesn't let me do this - because a cron run has no knowledge of nodes. If this is possible with rules module, please describe exactly how I would select the nodes. I do not see a way to do it.
I installed FullCalendar and it is nice, but it seems that it does not have this functionality.
So, this is probably going to be a past of a custom module. My question is: (1) which files in the custom module would this be written in, (2) how do I register this as a drupal cron task, (3) how do I select the relevant nodes, (4) how do I update the relevant nodes, (5) how do I send many emails.
Links to documentation on ^ these topics would be greatly appreciated. Actual code would be even better, but I think I can drive the code, given good documentation. And if this has already been implemented, please let me know.
Please login or register to post a comment.