How to batch and send emails based on lifecycle hooks

I’ve got a site where users can like posts - I wanna send an email notification for new likes

I can hook into the lifecycle for oncreate of a like and easily send an email. But I don’t want to send an email every single time - if there are 100 likes, i don’t wanna send 100 emails to 1 person

Is there any way to batch these into 1 email at the end of the day or something?
Does anyone have suggestinos?

Would it make sense to store a separate collection called notifications, and then add a record each time a notification is sent?
Then I could check if one was sent recently when a new like comes in, and not bother sending?

What’s an efficient way to do it?

This topic has been created from a Discord post (1251419430408421408) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord