Change reply message in twilio SMS API
I am working with twilio sms api integrated with coldfusion.This is the blog for change reply message in twilio SMS API.It is very simple just make a cfm file which return xml and check return body message like this ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfif form.body EQ "HELP"> | |
<cfsavecontent variable="response"> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Sms>This is Test Reply for help.</Sms> | |
</Response> | |
</cfsavecontent> | |
<cfelseif form.body EQ "STOP"> | |
<cfsavecontent variable="response"> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Sms>This is Test Reply for stop.</Sms> | |
</Response> | |
</cfsavecontent> | |
<cfelse> | |
<cfsavecontent variable="response"> | |
<cfoutput> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Sms>This is Test Thanks Reply. Reply HELP for help.Reply STOP to unsubscribe. Recvd: #xmlFormat(Left(form.body,75))#</Sms> | |
</Response> | |
</cfoutput> | |
</cfsavecontent> | |
</cfif> | |
<cfcontent type="text/xml" variable="#toBinary(toBase64( trim( response ) ) )#" /> |
Comments
Post a Comment