Skip to main content
Skip table of contents

Send E-Mail via XSLT

In addition to the conventional method, there is an additional server action in censhare to send e-mails via an XSLT command automatically.

Installation and Configuration

Example

XML
<xsl:stylesheet version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xi="http://www.w3.org/2001/XInclude"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:cs="http://www.censhare.com/xml/3.0.0/xpath-functions"
  xmlns:my="http://www.censhare.com/my">

 <xsl:template match="/">
    <cs:command name="com.censhare.api.Mail.SendMail">
       <cs:param name="source">
         <mails account-name="corpus">
            <mail subject="For {asset/@name}" sender-address="" replyto-address="">
             <recipient type="to" address="test@censhare.de"/>
                <multipart-body>
                  <content mimetype="text/html" transfer-charset="UTF-8">
                     <html>
                        <body>
                           <xsl:text>Hello world</xsl:text> 
                       </body>
                     </html>
                  </content>
                 </multipart-body>
             </mail>
           </mails>
         </cs:param>
       </cs:command>
     </xsl:template>

</xsl:stylesheet> 

Configuration

You can install the needed transformation by importing the assets in censhare-Server/install/assets/optional/email-transformation with the Import server action. The transformation represents only a "Hello world!" example and you must edit it accordingly before use. You can enable and configure the module in the censhare Admin Client under Modules|E-Mail|Send E-Mail using XSLT. Here you must select an appropriate mail transformation in the drop-down menu.

Only use one server name in Modules|E-Mail|Send E-Mail using XSLT. Otherwise, as many e-mails are sent as there are active servers.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.