CallXML 2.0 Development GuideHome  |  Frameset Home

This documentation is for CallXML 2, which has been superceded by CallXML 3. The CallXML 2 language is not being updated any longer. CallXML 3, however, has many new features and is actively being enhanced. If you're writing a new CallXML application, you should use CallXML 3. Click here for the CallXML 3.0 documentation.
<sendemail>  element

The 'sendemail' tag is a new addition to the CallXML arsenal. 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.


usage
<sendemail from="(email address)" subject="(email subject)" to="(email address)" type="(debug|none)">


attributes
fromData Type: (email address)Default: Required
The 'from' attribute allows the developer to specify a return address for emails sent through the 'sendemail' element. Any valid email address is allowed, provided that it is parseable.
subjectData Type: (email subject)Default: Optional
The 'subject' attribute allows the developer to specify a subject line that will be visible to the email recipient.
toData Type: (email address)Default: Required
The 'to' attribute allows the developer to specify a return address for emails sent through the 'sendemail' element. Any valid email address is allowed, provided that it is parseable.
typeData Type: (debug|none)Default: Optional
The 'type' attribute allows the developer to specify whether or not debugging output should be included in the message body of the email that is sent. Unless the setting of 'debug' is specified, the email will only contain the user data that is nested within the <sendemail> tags.



possible events
none


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


<callxml version="2.0">

  <block>
    <block>
      <playaudio value="Ingsoc.wav">
        <wait value="30s"/>
      </playaudio>

      <onhangup>
        <sendemail from="GeorgeOrwell@MinistryOfInformation.com"
                    to="WinstonSmith@Oceana.com">
              Received call from a comrade at $session.callerid; 
        </sendemail>

        <exit/>
      </onhangup>

    </block>
  </block>
</callxml>

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


<callxml version="2.0">

  <block>
    <block>
      <playaudio value="Ingsoc.wav" text="hello there jerky"/>

  <!-- WILL THIS THROW AN ERROR? -->
  <!-- YOU TELL ME...  -->

        <goto value="#BogusBlock"/>

        <onerror>
        <sendemail from="Orwell@MinistryOfInformation.com" 
                      to="WinstonSmith@oceana.com" type="debug">
          Winston, we caught an error in our application.  Details follow...
        </sendemail>

      </onerror>


    </block>
  </block>
</callxml>

Debug Email Sample
----- Original Message -----
From: Orwell@MinistryOfInformation.com
Sent: Wednesday, March 17, 2004 2:43 PM
Subject: SendEmail from CallXML



We caught an error in our application.  Details follow...

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

Date/Time                : 19:43:57 17/03/2004
Application ID            : 13565
Session ID                : ef70d3bd2da0ee62c88a01bafbea8497-75563
Current URL              : http://MyServer.com/MyApp.xml?session.ID=ef70d3bd2da0ee62c88a01bafbea8497-75563&session.callerid=1112223333&session.calledid=4445556666&callerID=4078350065&calledID=4445556666&session.accountid=000&session.applicationid=13565&session.outbounddialingflags=u&session.subaccountcode=&SubAccountCode=
Calling Number (ANI)      : 1112223333
Called Number (DNIS)      : 4445556666
Gateway Version          : 3.0.0.97
Last Error            : invalid target for goto or next attribute


=================================================================
CallXML Variables
=================================================================

session.ID = ef70d3bd2da0ee62c88a01bafbea8497-75563
sessionVarLock =
session.PrivateCallerID = false
session.RedirectedCalledID =
session.callerid = 1112223333
session.calledid = 4445556666
callerID = 1112223333
calledID = 4445556666
session.accountid = 000
session.applicationid = 13565
session.ttsdisplayname = English-Male1
session.outbounddialingflags = u
session.subaccountcode =
SubAccountCode =
session.LastError = invalid target for goto or next attribute

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

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

<callxml version="2.0">

  <block>
    <block>
      <playaudio value="Ingsoc.wav" text="hello there jerky"/>

      <goto value="#BogusBlock"/>

        <onerror>
        <sendemail from="Orwell@MinistryOfInformation.com
to="WinstonSmith@oceana.com" type="debug">
          We caught an error in our application.  Details follow...
        </sendemail>
      </onerror>


    </block>
  </block>
</callxml>

--





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