Java / Grails : Send SMS from application -


i have training management system in grails (grails version 2.0.4)

my requirement

  1. whenever user enrolls training must receive sms alert mobile number given while registering.
  2. sms indian mobile phones (as provide training in india)
  3. one way sms, application mobile (reply not required)

is there plugins available in grails? java way of doing work fine in grails application.

i have used twilio partner's app. paid service , rates international sms india here.

there grails plugin available twilio but, opted write custom code send , receive messages. there issues plugin, don't remember.

the barebones code looked like:

def twiliohttpendpointbean = new httpbuilder("https://api.twilio.com/2010-04-01/") def sid = 'your sid here' def auth_token = 'the auth token goes here' twiliohttpendpointbean.auth.basic(sid,auth_token) def result = twiliohttpendpointbean.request(method.post) { req ->      requestcontenttype = contenttype.urlenc     uri.path = "accounts/${sid}/sms/messages.json"     body = [ to: <destinationphonenumber>, from: <mainnumberusedtoregisterfortheservice>, body: 'your message' ]     response.success = { resp, data ->         def test = [status: data.status, sid: data.sid]         return test     }     response.failure = { resp, data ->         def test = [status: data.status, code: data.message]         return test     } } 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -