Skip to content

Commit f0e9a27

Browse files
committed
sms
1 parent 1237eba commit f0e9a27

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

routes/user.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,30 @@ router.post('/update_invoice_by_group_id/:id', verifyToken, (req, res, next) =>
945945
}).catch(next)
946946
})
947947

948+
949+
router.post('/test_textlocal', verifyToken, (req, res, next) => {
950+
let otp = "5555";
951+
let event = 'Sample Event'
952+
let date = '12th March 2020'
953+
let team_name = 'Cycles FC'
954+
let type = '5s'
955+
let sport = 'Football'
956+
let booking_id = 'TTE001123'
957+
let amount = 'Rs.200'
958+
let balance = 'Rs.1000'
959+
let numbers = "917358496318"
960+
let sender = "TRFTWN"
961+
let mes = 'You have received a new registration. Event : passs\nDate :12th January 2005\nTeam Name : Hipaass \nType: 5s \nSport: football \nRegisteration ID : TTE00123\nAmount Paid : 100\nBalance to be paid at event : 200\nDo get in touch with the team and communicate further details'
962+
let message = "You have received a Turftown event booking \nEvent: "+event+" \nDate: "+date+" \nTeam Name: "+team_name+" \nType: "+type+"\nSport: "+sport+"\nRegisteration ID: "+booking_id+"\nAmount Paid: "+amount+"\nBalance to be paid at the event: "+balance
963+
let m = 'This is a test message'
964+
//Send SMS
965+
axios.get(`https://api.textlocal.in/send/?apikey=${process.env.TEXT_LOCAL_API_KEY}&numbers=${numbers}&sender=${sender}&message=${m}`).then(response => {
966+
res.send(response.data)
967+
}).catch(error=>{
968+
console.log(error)
969+
})
970+
})
971+
948972
function isEmpty (object){
949973
if(Object.keys(object).length>0){
950974
return true

0 commit comments

Comments
 (0)