E-mail

The E-Mail component type wraps the SMTP protocol. It can be invoked synchronously or asynchronously. The configuration allows you to set static From, To, CC and BCC addresses or dynamically retrieve them by specifying an XML path.

Note: If the e-mail being sent contains HTML content, the XSL that is transforming the input XML to the HTML format should have a comment such as the following example:

<xsl:comment>CONTENT_TYPE=text/
html</xsl:comment>, so the transformed HTML has a comment: <!--CONTENT_TYPE=text/html-->

The framework uses this information to set the content_type to text/html, if this comment is not present the content_type is set to text/plain.

Configuration properties

The following are the properties of this node:

Table 1. E-mail configuration properties
Property Description
E-mail Server Enter the name or IP address of the mail server.
E-mail Server Listener Port Enter the port number of the mail server.
Subject Enter what you want to appear in the subject line of the e-mail.

If you specify XML in the format of xml://<ElementName>/@<AttributeName>, it is replaced dynamically with the value from the input XML data. For example, the text “Thank you for your online Order xml://Order/@OrderNo” is a combination of static and dynamic text that results as “Thank you for your online Order MyOrder005”.

Body Template XSL file that contains formatting to apply to the body of the message. Sterling Order Management System Software supplies the <INSTALL_DIR>/repository/xapi/template/merged/email/orders_mail.xsl file.
From Can be static or dynamic with the XML path specified as xml://<ElementName>/@<AttributeName>. Use semi-colons as a delimiter between addresses.
To Required. Can be static or dynamic with the XML path specified as xml://<ElementName>/@<AttributeName>. Use semi-colons as a delimiter between addresses.
CC Can be static or dynamic with the XML path specified as xml://<ElementName>/@<AttributeName>. Use semi-colons as a delimiter between addresses.
BCC Can be static or dynamic with the XML path specified as xml://<ElementName>/@<AttributeName>. Use semi-colons as a delimiter between addresses.
Note: You can use an International Resource Identifier (IRI) for the host name portion of fields, such as the email server, from, to, cc, and bcc addresses.

Connection properties

These are the connection properties of this node:

Table 2. E-mail connection properties
Connection Node Connection Rules
Can be the first node after the start node Only for services invoked synchronously
Can be placed before
  • Any transport node except for FTP or File I/O
  • Any other component node
Can be placed after
  • Start node
  • Any transport node except for FTP or File I/O
  • Any other component node
Passes data unchanged Yes
Note: The SMTP connection objects can be pooled based on the service being executed. Hence whenever the SMTP sender require a connection object the Application Platform framework tries to get a free connection object from the pool. If the connection objects in the pool are occupied or if the pool is empty, then a new connection object is created to send the message and then added to the pool. Any connection object idle for a certain configurable period of time and can be closed by the framework. For information about setting the properties for connection reaptime, check the yfs.properties file in <INSTALL_DIR>/properties directory.

The yfs.smtp.session.reaptime property in the yfs.properties file is used to set the JMS session reaptime. To modify this property, add an entry for it in the <INSTALL_DIR>/properties/customer_overrides.properties file.