I'm creating a web application in play2.0 framework.In this application i need to integrate SMS and EMAIL reminder to send sms and email on a particular date and time by getting the details from database. For that is there any Free API's or scheduler or web service or applications ? If there is any then kindly let me know how to use ? thanks in advance.
how to integrate SMS & EMAIL Reminders in my play2.0 framework web application.
Asked Answered
In Play 1.x, this would have been achieve with the concept of Jobs. In Play 2.x, asynchronous execution of code is done using Akka's scheduler.
So, from your use case, you will probably want to have a job that runs every few minutes (lets assume 30 for the example), that goes off to the database and checks to see if any emails need to be sent. From here, you can then 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 services for sending SMS, you could check out Twilio ( http://www.twilio.com/api/sms ). You just need to integrate using the play.libs.WS
class.
Email is a trivial part of the puzzle, and has been answered many times over already, so I won't go into detail on that.
© 2022 - 2024 — McMap. All rights reserved.