Configuring transfer notifications

Transfer notification emails are triggered by three transfer session events: start, completion, and error. Transfer notification emails can be enabled and configured globally and by each user. The emails are generated from mail templates that can be customized.

Note: The GUI must remain open for transfer notification emails to send. Closing the GUI stops email notifications.

Enable email notifications

  1. Start HSTS with root permissions.
    Go to Finder > Applications > IBM Aspera High-Speed Transfer Server
  2. To configure global email notification settings, follow these steps:
    1. Click Tools > Global Preferences.
      ""
    2. Click Mail.
      Mail
    3. To turn on email notifications for all users, select Enable email notifications.
      Enter the email address from which the notifications are sent in the From Address field and enter the outgoing email server hostname in the Host field. The other values are optional.
    4. To test your settings, click Send test email, which sends a test message to the From Address.
  3. Set your personal mail preferences.
    Personal mail preferences override global settings.
    1. Click Preferences.
    2. Click Mail and edit the inherited global default values.
      "Mail"

      To restore your settings to global values, click Restore Defaults.

Configure email templates

  1. Open the Mail Templates window by clicking Tools > Mail Templates.
    Mail Templates
  2. To create a new template, click The Create a new template button, or to edit an existing template, select the template and click The Edit the selected template button
    The Mail Templates window.
  3. For new templates, name the template and select its base template.
    Select an existing template from the Based On menu. Click OK.
  4. Edit the template text.
    The Edit Template window has four fields:
    Field Description
    Name The template name.
    HTML The HTML mail body. Click Insert Image to insert an image into the template. The image is copied to the template directory. Preview the template by clicking Preview.
    Text The plain text mail body. Preview the template by clicking Preview.
    Access Select Share this template with all users on this computer to allow other system users to access this template.
    The Edit Templates window.

    The mail template supports MIME (Multipurpose Internet Mail Extensions) multipart messages. You can edit both the HTML and plain text versions of the mail body. The templates are rendered by Apache Velocity (for more information, see the Apache Velocity User Guide at http://velocity.apache.org/). Templates use two predefined variables:

    • $formatter - Contains some utility methods.
    • $notifications - Holds the transfer notifications.

    To iterate over notifications, use a foreach loop. A foreach loop generates content for each iteration of the loop. In the following example, a local $event variable is declared for use within the foreach loop:

    #foreach ($event in $notifications.getEvents())
     ...
    #end

    To generate content only under specific conditions, use a conditional statement. To construct a conditional statement, use #if, #else, and #end, with the following syntax:

    #if
     ...
    #else
     ...
    #end

    All conditional statements are categorized in four parts: the conditional (what must occur to trigger the action), session information (what action is triggered), time, and statistics.

    Conditional

    Use conditional tests in an if statement. For example,

    #if ($event.isFailed())
     ...
    #end
    Statement Description
    $event.isStarted() If the transfer session is started.
    $event.isCompleted() If the transfer session is completed.
    $event.isEnded() If the transfer session is ended.
    $event.isFailed() If the transfer session is failed.

    Session information

    Statement Description
    $event.getSourceHost() The source hostname (or host address if the hostname is not discoverable).
    $event.getSourceHostAddress() The source host address.
    $event.getSourcePaths() The source file path.
    $event.getDestinationHost() The destination hostname (or host address if the hostname is not discoverable).
    $event.getDestinationHostAddress() The destination host address.
    $event.getDestinationPath() The destination file path.
    $event.getInitiatingHost() The session-initiating hostname (or host address if the hostname is not discoverable).
    $event.getInitiatingHostAddress() The session-initiating host address.
    $event.getId() The session ID.
    $event.getName() The session name.
    $event.getType().getDescription() The session state. The three outputs are: STARTED, FAILED, and COMPLETED.
    $event.getUser() The transfer login.
    $event.getFiles() The files that are being transferred. Use this statement in a foreach loop: (Any text after ## is a comment)
    #foreach ($file in $event.getFiles())
     ## $file is a new variable visible in this foreach loop.
     ## $file holds the complete file path and file name.
     ## $formatter.decodePath() is used to ensure a correct string decoding.
     $formatter.decodePath($file)
    #end
    Use the counter $velocityCount in an if statement to limit the output file count. For example, to list only the first 10 files:
    #foreach ($file in $event.getFiles())
     #if ($velocityCount > 10)
      #break
     #end
     $file
    #end
    $event.getMessage() The message that is entered in the email Message field.
    $event.getError() The error message.

    Time

    Statement Description
    $formatter.date(var, "lang", "format") Formatting the date and time output. Enter three values in the parenthesis:
    • var is either $event.getStartTime() or $event.getEndTime()
    • lang is an abbreviated language name; for example, en for English.
    • format is the display format. Use these symbols:
      • yyyy - The year; for example, 2010.
      • MM - Month of the year; for example, 03.
      • dd - Day of the month; for example, 26.
      • HH - Hour of the day; for example, 16.
      • mm - Minute.
      • ss - Second.
      • z - Time zone.
      • EEE - The abbreviated weekday name; for example, Fri.
      For example,
      "EEE, yyyy-MM-dd HH:mm:ss z"
      shows Fri, 2022-03-25 16:19:01 PST.
    $event.getStartTime() The session start time.
    $event.getEndTime() The session end time.

    Statistics

    Statement Description
    $event.getSourceFileCount() The number of source files.
    $event.getCompletedFileCount() The number of files that successfully transferred.
    $event.getFailedFileCount() The number of files that failed to transfer.
    $event.getAverageRatePercentage() The average transfer rate in bps. Enclose this statement with $formatter.formatRate() to simplify the output.
    $event.getAverageLossPercentage() The average packet loss percentage.
    $event.getSourceSizeB() The source file size. Enclose this statement with $formatter.toBestUnit() to simplify the output.
    $event.getTransferredB() The transferred file size. Enclose this statement with $formatter.toBestUnit() to simplify the output.
    $event.getWrittenB() The destination file size. Enclose this statement with $formatter.toBestUnit() to simplify the output.
  5. Click OK to save your changes.

Apply the notifications to a specific connection host or a transfer session. You can also customize the subject line of the notification emails, for details see Using transfer notifications.