User Guide
SMS gateway message sending commands 1049
Example
The following example onIncomingMessage method sends a response that echoes an incoming
message to the originator address, and sends a copy of the response to a second address:
<cffunction name="onIncomingMessage" output="no">
<cfargument name="CFEvent" type="struct" required="yes">
<!--- Get the message. --->
<cfset data=cfevent.DATA>
<cfset message="#data.message#">
<!--- Create the return structure. --->
<cfset retValue = structNew()>
<cfset retValue.command = "submitmulti">
<cfset retValue.destAddresses=arraynew(1)>
<!--- One destination is incoming message originator;
get the address from CFEvent originator ID. --->
<cfset retValue.destAddresses[1] = arguments.CFEvent.originatorid>
<cfset retValue.destAddresses[2] = "12345">
<cfset retValue.shortMessage = "echo: " & message>
<cfreturn retValue>
</cffunction>