New Features

Release date : Friday, September 4, 2009
C1 version: Composite C1 1.2 SP2 (1.2.3534.23578)...
Description : An ability to send e-mails by defining a fuction call in an XSLT layout. Attachments will also be supported.

Xslt function example:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:in="http://www.composite.net/ns/transformation/input/1.0"
 xmlns:f="http://www.composite.net/ns/function/1.0"
 xmlns:c1="http://c1.composite.net/StandardFunctions"
 xmlns="http://www.w3.org/1999/xhtml" 
 exclude-result-prefixes="xsl in f">
 <xsl:template match="/">
  ...............

   <xsl:if  test="$formSubmitted">
    ....
    <xsl:choose>
      <!-- Checking whether the e-mail adress is valid with help of the extension method -->
      <xsl:when test="c1:IsEmailValid($email)">
     <!-- Declaring a function call markup in a variable -->
     <xsl:variable name="SendMailFunctionMarkup">
      <f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Mail.SendMail">
       <f:param name="From" value="{$from}" />
       <f:param name="To" value="{$to}" />
       <f:param name="Subject" value="{$subject}" />
       <f:param name="Body" value="{$body}" />
       <f:param name="IsHtml" value="True" />
      </f:function>
     </xsl:variable>

     Sending the mail. <br />
     <!-- Calling "SendMail" function, the result is a boolean that indicates whether the mail has been sent successfully -->
     Success:    <xsl:value-of select="c1:CallFunction($SendMailFunctionMarkup)" />
      
      </xsl:when>
      <xsl:otherwise>
         Email address is invalid
      </xsl:otherwise>
    </xsl:choose>  
    ......
  </xsl:if>
    ....
 </xsl:template>
</xsl:stylesheet>

New Features