XSLT Mapping for Outgoing Emails

This feature allows to define XSLT templates for manipulating data mapping of outgoing emails. All email specific data are available for the mapping. Additionally any ticket related data including dynamic fields are provided if an article is sent. The XSLT template must contain at least the following mappings:

To / Cc / Bcc
From
Subject
Body
Charset

Desired additional email headers are set via the CustomHeaders element. Any empty element (for example due to missing mapping data) is rejected.

The difference of origin email data and mapped data is recorded in the Communication Log with priority debug.

Example XSLT template

This template can be used in the Sendmail::XSLT::Template system configuration setting.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" encoding="utf-8" indent="yes"/>
  <xsl:template match="/RootElement">
    <NewRootElement>
      <To>
        <xsl:value-of select="/RootElement/To" />
      </To>
      <From>
        <xsl:value-of select="/RootElement/From" />
      </From>
      <Subject>
        <xsl:value-of select="/RootElement/Subject" />
      </Subject>
      <MimeType>
        <xsl:value-of select="/RootElement/MimeType" />
      </MimeType>
      <Charset>
        <xsl:value-of select="/RootElement/Charset" />
      </Charset>
      <Body>
        <xsl:value-of select="/RootElement/Body" />
      </Body>
      <CustomHeaders>
        <X-OTRS-Charset>
          <xsl:value-of select="/RootElement/Charset" />
        </X-OTRS-Charset>
        <X-OTRS-From>
          <xsl:value-of select="/RootElement/From" />
        </X-OTRS-From>
        <X-OTRS-TicketNumber>
          <xsl:value-of select="/RootElement/Ticket/TicketNumber" />
        </X-OTRS-TicketNumber>
      </CustomHeaders>
    </NewRootElement>
  </xsl:template>
</xsl:stylesheet>
Scroll to Top