Parameters of the message templates

From ISPWiki

Jump to: navigation, search


Template functions

Message templates can be used to form notifications that are sent to BILLmanager customers.

The process of creating a message includes the system objects which parameters should be included into the XML document, and an XSLT template.

Before sending a message to customers, BILLmanager collects information about required objects and places their parameters into the XML document to which the XSLT template will be applied.

Editing template

Edit a message template for each locale you have configured in the system. While creating the template, you may use the mechanisms described below.

Editing template text

A text template is an XSLT stylesheet that will be applied to the XML document that contains the information about BILLmanager objects required for providing information about the event that caused a message to be sent.

In this section we will describe how to create a simple message stylesheet.

Below is an empty stylesheet:

<?xml version='1.0'?>                                                          
<xsl:stylesheet version='1.0' xmlns:xsl='' xmlns:mgr="">
<xsl:output method='text' encoding='UTF-8' omit-xml-declaration='yes'/>
<xsl:template match='doc'>


  • xmlns:mgr=""> - additional function name space:
    • replace - replace one character set into another in the text. It has three parameters: where to replace, what to replace and into what to replace.
    • random - generate random figures.
    • strsum - output textual representation of the sum. It has two parameters: currency amount and currency id. You may use UAH for currency, any other value will output amount in roubles.
    • dateformat - required date format. Example: "select="mgr:dateformat('2011-12-31', '%A, %d, %B, %Y')" outputs "Sunday, 31, December, 2011". You can specify the format the same way as in the "strftime" function of the "С" language.
    • encodesubject - encode the text into Base64.
    • escapeurl - escape URL symbols;
  • The xsl:stylesheet tag - beginning of the stylesheet text.
  • The xsl:output tag - format of the stylesheet output
  • The xsl:template tag - beginning of the stylesheet template. match='doc' means that all the data will be selected from "doc" of the XML document.

The xsl:template tag contains description of the stylesheet that will be included into the message, data sampling and conditional branching.

First three columns of the message template should contain the data required for a mail gateway to correctly send messages, such as "From:", "Subject:" and "Content-Type:". Following is a standard part of the stylesheet for these fields in BILLmanager:

From: <xsl:value-of select="project.notifyemail"/>
Subject: <xsl:value-of select="mgr:encodesubject('Message subject')"/>
Content-Type: text/plain; charset=utf-8

If you need to add data from the XML text into the message, you may use <xsl:value-of select='xpathquery' disable-output-escaping='yes'/>, where xpathquery is the data sampling XPath request.

For example, if you have the XML document:

<?xml version="1.0" encoding="UTF-8"?>
  <>Hosting services ServicePlanName #1 (user1), 1 month</>

to display "item.billdate", you need to use "<xsl:value-of select="item.expiredate"/>"

In your template you may use any constructions that are allowed in XSLT.

Testing template

While creating the message template, you can see a resulting message for a BILLmanager database object. To do that, you can use the Test function in the Message template module.

This procedure involves 3 steps:

  • Enter database object parameters;
  • View the XML document to which the style will be applied;
  • View the results.

Template parameters

Each message in BILLmanager includes a number of parameters that BILLmanager will prompt you to enter to specify an object for which a message is created. The following is a list of parameters:

  • autoaddon
    • - add-on identifier.
  • autoprolongwarning
    • items - two values separated by '='. The first value is an item identifier, the second one is a renewal cost.
  • coloopen, dedicopen, dnsopen, rhostopen, rvdsopen, vdsopen, vhostopen, licopen, newcertificate, itemsuspend
    • - item identifier.
  • confirmemailnotify
    • - mail gateway identifier.
    • - user identifier.
  • creditgeneratenotify
    • - account identifier.
  • domainerroroperation
    • operation - an error occurred while performing this operation.
    • - domain identifier.
    • errorparams - contact fields that contain errors.
    • contactid - domain registration contact identifier.
    • msgerror - error message.
  • domainsenddocs
    • items - identifiers of the domains space for which documents are required.
  • domautorenew, domexpirewarning
    • items - domain identifiers space separated.
  • errorcertificate
    • - identifier of the certificate that caused an error.
  • expirecertificate
    • - expiring certificate identifier.
  • itemexpirewarning
    • items - item identifiers space separated.
  • licautoprolong, licexpired, licexpirewarning
    • items - license identifiers space separated.
  • lowmoney
    • - payer identifier.
    • days, balance, daily - parameters are transferred to XML without processing.
  • moreaccountnotify
    • - gateway identifier.
  • nearaddonmax, overaddonmax
    • - item identifier.
    • - identifier of the service package detail.
  • newadminmessagenotify
    • - message indentifier.
  • newmessagenotify, newresponsenotify
    • - ticket identifier.
    • userid - user identifier.
    • in_reply_to - transferred to XML without processing.
  • newsnotify
    • - message identifier.
  • overlimit
    • - item identifier.
    • - service overage expense identifier.
  • recovery
    • - user identifier.
  • registration
    • - customer identifier.
  • unknownemailnotify
    • - gateway identifier.

Messages for user item types have only the parameter (an item identifier).

XML document

An XML document contains BILLmanager database object data to be used when forming a message. These data are specific for each notification. You can view them using the test function.

Was this helpful? Yes | No
Personal tools