Skip to main content

 Configuration

Configuration manual for PageSeeder

External email template

This notification can be sent using a PageSeeder service. For further information, see send-mail service.

Email headers

NameValue
Auto-Submittedauto-generated
FromDepends on service from parameter or defined by template
SubjectDepends on service subject parameter or defined by template
ToDepends on service notify parameter
Reply-ToDepends on XML <replyto> element or defined by template

There is a default XSLT template which requires a certain XML format, but ultimately the XML source is arbitrary and at the discretion of the app sending the notification.

The content given to the send-mail service is automatically wrapped in a <notification> element and has a <group> element added before the XSLT transformation is processed.

Default XML

Following is an example of the XML supported by the default XSLT template.

<notification template="external"
              description="External"
              unsubscribetoken="sample-token"
              emaildomain="ps.pageseeder.com"
              hosturl="https://ps.pageseeder.com/ps">
  <message>
    <replyto name="My App" email="myapp@example.org" />
    <content type="text/plain">External email!
                               This is an external email.
    </content>
    <content type="application/xhtml+xml">
      <h4>External email!</h4>
      <p>This is an <b>external</b> email.</p>
    </content>
  </message>
  <group id="3"
         name="acme-test"
         description="The ACME testing group">
  </group>
</notification>

Default appearance

Following is a a screenshot of how the default XSLT template would format the above XML.

External email (HTML)

Arbitrary XML

Following is an example of arbitrary XML source.

<notification template="external"
              emaildomain="example.org"
              hosturl="https://example.org">
  <myformat>
    <sender email="dev@ps.pageseeder.com">PS Dev Team</sender>
    <heading>Welcome Email!</heading>
    <content>This is an external email with some <b>HTML</b>
             content.
    </content>
    <signature>The PageSeeder Dev Team</signature>
  </myformat>
  <group id="3"
         name="acme-test"
         description="The ACME testing group">
  </group>
</notification>

XSLT

Following is an example of a message created by processing the arbitrary XML source with the following XSLT template.

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XS/Transform">
  <!-- Main template -->
  <xsl:template match="/notification/myformat">
    <html>
      <head>
        <meta http-equiv="Content-Type"
              content="text/html;charset=UTF-8" />
        <meta name="sender-name"
              content="{sender}" />
        <meta name="sender-email"
              content="{sender/@email}" />
        <title>Email title</title>
      </head>
      <body>
        <h1><xsl:copy-of select="heading" /></h1>
        <p><xsl:copy-of select="content" /></p>
        <hr/>
        <p><xsl:copy-of select="signature" /></p>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

Result

Generated email message: 

 

external2.png

Created on , last edited on