CCXML 1.0-W3C Development GuideHome  |  Frameset Home


<voxeo:sendemail>  element

The 'sendemail' tag is a new extension element to Voxeo's arsenal of CCXML coolness. This tag allows you to programmatically send an email to a user specified destination. Additionally, this new element also allows you to output debugging information in the body of the email, which is a very useful 'watchdog' feature that allows you to be alerted via email whenever errors are encountered within the application. Also note that the 'xmlns:voxeo' attribute must be declared and mapped to the proper voxeo namespace, (see the 'ccxml' element listing for details).


usage
<voxeo:sendemail body="CDATA" from="(email address)" to="(email address)" type="CDATA">


attributes
bodyData Type: CDATADefault: Optional
The 'body' attribute allows the developer to specify text to insert in the body of the email that is sent out when the element is executed.
fromData Type: (email address)Default: Required
The 'from' attribute allows the developer to specify a return address for emails sent through the 'voxeo:sendemail' element. Any valid email address is allowed, provided that it is parseable.
toData Type: (email address)Default: Required
The 'to' attribute allows the developer to specify a return address for emails sent through the 'voxeo:sendemail' element. Any valid email address is allowed, provided that it is parseable.
typeData Type: CDATADefault: none - attribute is optional
The 'type' attribute defines the type of email to be sent to the maintainer of the CCXML application. If unspecified, then the resulting email message must be entirely user defined within the 'body' attribute. If, however, the 'type' is set to 'debug', then a whole host of debugging output is included in the body of the email, (very useful information to have for troubleshooting an application that goes belly-up when you aren't watching the realtime logger).



parents
none


children
none


code samples
<1.0 voxeo:sendmail>
<?xml version="1.0" encoding="UTF-8" ?>
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml" xmlns="http://www.w3.org/2002/09/ccxml">

<meta name="author" content="Jeff Menkel"/>
<meta name="copyright" content="2007 Voxeo Corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<var name="statevar" expr="'init'"/>
<var name="myVar1" expr="'foo1'"/>
<var name="myVar2" expr="'foo2'"/>

  <eventprocessor statevariable="statevar">


    <transition state="init" event="ccxml.loaded">
      <assign name="statevar" expr="'fetching'"/>

    <!-- ATTEMPT TO FETCH A BOGUS URL TO FORCE AN ERROR-->
      <fetch next="'http://myserver.com/myBogusURL.xml'"
            method="'get'"
            fetchid="'fetch1'"
            namelist="myVar1 myVar2"/>
    </transition>

    <transition  state="fetching" event="ccxml.fetch.done">
      <goto fetchid="event$.fetchid"/>
    </transition>

    <transition state="fetching" event="error.fetch">
      <log expr="'*** FETCH ERROR [' + event$.reason + '] ***'"/>

      <!-- CATCH THE ERROR, AND SEND EMAIL -->
      <voxeo:sendemail to="'yourEmail@here.com'"
                        from="'sender@here.com'"
                        type="'debug'"
                        body="'We had an error! \n Time to panic! \n
                            Flee the cities, abandon all hope! \n
                            Or, just send this email to the support
                            folks.'"/>

      <exit/>
    </transition>

  </eventprocessor> 
</ccxml>

<1.0Sample Debug Email>
----- Original Message -----
From: MyApp@here.com
Sent: Thursday, March 18, 2004 3:06 PM
Subject: SendEmail from CCXML



We had an error!
Time to panic!
Flee the cities, abandon all hope!
Or, just send this email to the support folks.

=================================================================
Session Details
=================================================================

Date/Time                : 20:06:54 18/03/2004
Application ID            : 19853
Session ID                : 3f0d9bfb10e6941025b1338e742adf49
Initial URL              : http://MyServer.com/MyApp.xml
Current URL              : http://MyServer.com/MyApp.xml
Calling Number (ANI)      : 1112223333
Called Number (DNIS)      : 4445556666
Last Error                : path executed


=================================================================
CCXML Variables
=================================================================

URL1 = http://MyServer.com/MyApp.xml
URL2 = undefined
URL3 = undefined
redirectNumber = undefined
state0 = fetching
myVar1 = foo1
myVar2 = foo2
'fetch1' = 8299161c79f5c68ff136ecf6c56f2e20

=================================================================
Current Document
=================================================================

<?xml version="1.0" encoding="UTF-8" ?>


<!-- NOTE THAT WE *MUST* DECLARE THE xmlns ATTRIBUTE -->
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">


<var name="state0" expr="'init'"/>
<var name="myVar1" expr="'foo1'"/>
<var name="myVar2" expr="'foo2'"/>

  <eventprocessor statevariable="state0">

<!-- ************ CCXML LOADS / FETCH NEW DOCUMENT ************ -->
    <transition state="init" event="ccxml.loaded" name="event$">
      <assign name="state0" expr="'fetching'"/>
      <fetch next="'http://myserver.com/myBogusURL.xml'"
            method="'get'"
            fetchid="'fetch1'"
            namelist="myVar1 myVar2"/>
    </transition>

    <transition  state="fetching" event="ccxml.fetch.done" name="event$">
      <goto fetchid="event$.fetchid"/>
    </transition>

    <transition state="fetching" event="error.fetch" name="event$">
      <log expr="'*** FETCH ERROR [' + event$.error + '] ***'"/>
<voxeo:sendemail to="'mhenry@voxeo.com'"
                      from="'MyApp@here.com'"
                      type="'debug'"
                      body="'We had an error! \n Time to panic! \n
                            Flee the cities, abandon all hope! \n
                            Or, just send this email to the support folks.'"/>


      <exit/>
    </transition>



  </eventprocessor>   
</ccxml>
--



additional links
none


  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login



© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site