How to integrate SMS and EMAIL reminders in my web application for the play2.0 platform.

I am creating a web application as part of play2.0. In this application, I need to integrate SMS and EMAIL reminders to send SMS and email at specific dates and times, receiving data from the database. Is there a free API, scheduler, or web service or application for this? If so, please kindly let me know how to use? thanks in advance.

0
source share
1 answer

In Play 1.x, this would have been achieved with Jobs' concept. In Play 2.x, asynchronous code execution is performed using the Akka scheduler.

So, from your use case, you probably want to get a task that runs every few minutes (for example, 30 is acceptable), which is sent to the database and checks if emails should be sent. From here you can call your web service to send SMS and email.

Akka.system().scheduler().scheduleOnce( Duration.create(30, TimeUnit.MINUTES), new Runnable() { public void run() { // check database for reminders that need to be sent // send email // send SMS } } ); 

As for the services for sending SMS, you can check Twilio ( http://www.twilio.com/api/sms ). You just need to integrate with the play.libs.WS class.

Email is a trivial part of the puzzle, and it has already been answered many times, so I will not dwell on this in detail.

+1
source

Source: https://habr.com/ru/post/984479/


All Articles