Skip to main content
Skip table of contents

Dynamic E-mail

Dynamic e-mails are created with variable content and SMTP parameters. For instance, the list of recipients may be generated from a database query. For the dynamic content of an e-mail body, you may also use the output from other actions (like system messages, error messages, etc.), text data from a file, or any other backend system.

Example File (Builder project Add-ons/EMail):

<your example path>\Add-ons\EMail\uml\smtpEmailing.xml

Dynamic E-mail Activity Diagram

The input parameters will be mapped to objects that will be passed to the SMTP adapter in the activity diagram (see picture below).

Figure: Dynamic E-mail Activity Diagram


In the action node create parameters parameters, the input parameters of input object email are mapped to the central buffer nodes (dynamic parameters) that will in turn be passed to the SMTP adapter (action node mail the content).

Header Parameters

The xUML Runtime assigns a correlation ID to each adapter call. This ID is stored in header field X-Bridge-CorrelationID. Adapter calls can be identified by this ID. Also, it is logged to the transaction log.

SMTP Adapter Parameters

NameTypeDirectionDescription
domainNameStringinSupplies the sender domain the e-mail is sent from. Normally this is the FQDN (Fully Qualified Domain Name) of the system the Bridge is running on (e.g. e2e.ch).
serverStringinSupplies the name of the smart host. If no server is specified, localhost will be used.
portIntegerinSupplies the SMTP port of the smart host. If no port number is specified, 25 will be used.
userStringinSupplies the user part of the credentials.
passwordStringinSupplies the password part of the credentials. 
senderStringin

Supplies the e-mail address of the sender of the e-mail. It contains the plain address without comments or real name parts (e.g. order@e2e.ch). If you do not specify a sender, the e-mail cannot be delivered successfully.

The sender defines the Return-Path value of the message header. Some smart hosts check, if the sender's address is legitimate before accepting the e-mail. If the from field is provided in the header parameters, its value will be displayed in the e-mail client instead of the sender.

recipientsArray of StringinEach array element identifies one recipient of the e-mail, and contains the plain address without comments or real name parts.
headerParametersArray of MIMEHeaderFieldin

Supplies an array of custom SMTP header parameters with name - value pairs (to, cc, bcc, from, subject, reply-to, etc.).

You need to provide the e-mail addresses of all recipients in array recipients!
If no recipients are defined, the service will return an error. Recipients, which are defined in the array attribute headerParameters are only used to display the to, cc, and bcc fields in the receiver's e-mail client. They will not be used for the list of real recipients, unless you define them explicitly in the tagged values of the SMTP adapter as shown for static e-mailing.

If you use the e-mail client function Reply All upon receiving the e-mail, the recipients of the new e-mail will be generated from the original SMTP header parameters, and the sender, unless the from field was defined in the message header.

Examples:

  • Name: to
    Value:
    Customers 
  • Name: subject
    Value:
    Order E2E Bridge
  • Name: reply-to
    Value:
    info@e2e.ch
contentBlobinThe body of the e-mail may contain any kind of data and is wrapped in an object of base type Blob.

Testing Dynamic E-mail

The following figure shows input parameters entered in the SOAP Test Tool for the dynamic e-mail example shown in figure Dynamic E-mail Activity Diagram above.

Figure: Input Parameters for a Dynamic E-mail

The picture below shows the received e-mail displayed in an e-mail client.

Figure: Example of a Received E-mail

The address "test receiver" in the to field of the e-mail client is not an e-mail address of one of the real recipients. The real recipients are test2@e2e.ch and test3@e2e.ch as defined in the recipients array of the input object sent to the service (see Figure: Input Parameters for a Dynamic E-mail).
The same with the sender address "test sender", the real e-mail address is test1@e2e.ch and is set as return-path in the message header. The message header of this e-mail is shown below:

NONE
Microsoft Mail Internet Headers Version 2.0
Received: from smtp.rednet.ch ([172.31.2.131]) by SRHMCBEXV01.RedNet.hmc with Microsoft SMTPSVC(6.0.3790.1830);
          Fri, 17 Aug 2007 15:23:23 +0200
Received: from mail17.bluewin.ch ([172.31.1.1]) by smtp.rednet.ch with Microsoft SMTPSVC(6.0.3790.1830);
          Fri, 17 Aug 2007 15:23:23 +0200
Received: from e2e.ch (81.63.174.116) by mail17.bluewin.ch (Bluewin 7.3.121)
          id 46A5457300544277; Fri, 17 Aug 2007 13:27:34 +0000
Message-ID: <46A5457300544277@mail17.bluewin.ch> (added by postmaster@bluewin.ch)
to: test receiver
subject: testmail
from: test sender
Date: Fri, 17 Aug 2007 13:27:34 UTC
Content-Type: text/plain; charset="utf-8"
Return-Path: test1@e2e.ch
X-OriginalArrivalTime: 17 Aug 2007 13:23:23.0080 (UTC) FILETIME=[C9254C80:01C7E0D1]

Related Pages:

JavaScript errors detected

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

If this problem persists, please contact our support.