Play framework, limit an action to be done once

107 views Asked by At

I have a button follow on my website, you can toggle it on or off as much as you want. Each time it sends a notification mail to the followed people. I don't want him to be spammed.

So I want Play Framework not to send this mail twice (twice in a day, for example)

Is there any built-in mechanism or any library of play framework to do it?

Thanks !

EDIT : Preferably an external service, like Mailjet or mailchimp.

1

There are 1 answers

1
biesior On

Just save notification to DB instead of sending it immediately - so user can decide how often he want's to get it.

Next use Akka scheduler for sending many notifications in single emails from time to time.