-1

I am using Symfony 5.2 and messenger with sengrid for sending mails.

I want to send an email when a specific action is taken. But this action can be repeated several times in a row and I don't want to spam my users. I would like to store these emails before sending, and run a CRON every hour. CRON would group into a single email if emails are intended for the same users and send them. I wish to know the best method to do this.

I specify that the easiest way is to create a dedicated table at the base but I wonder if there is not a better method with symfony

PS: Sorry for my english

Thank you in advance.

2kne
  • 1

1 Answers1

0

I don't know what kind of message broker you use, but with RabbitMQ you can do something like :

  • Consume a message
  • Consume an another message, if it's the same action : redo this to the next message, else requeue it and do something with yours messages

It's a way to group a lot of message easily.