Configuring Transfer Notifications

Transfer notification emails are triggered by three transfer session events: start, completion and error. These emails are generated from default or customized mail templates. Follow the instructions below to configure the SMTP server and to create or modify your email templates.

  1. Launch Point-to-Point with root permissions.
    Run asperascp in a terminal shell as root to launch the application.
  2. Open Global Preferences by clicking Tools > Global Preferences.
    Launch global preferences.
  3. Click the Mail button to configure global email notification settings.
    To turn on email notifications for all users, select Enable email notifications. If enabled, both a From Address and outgoing email server host name are required. To ensure that the mail server information is correct, click Send test email; a test message will be sent to the From Address.
    Global Mail Preferences.
  4. Set user mail preferences.
    To override the global mail settings and enter personal settings for your account, click Tools > Preferences or click the Preferences button:

    Click Mail and edit the inherited global default values, including enabling or disabling notifications. To restore settings to the global values, click the Restore Defaults button.

  5. Open the Mail Templates window by clicking Tools > Mail Templates.
    Launch the Mail Templates window.
  6. To create a new template, click Create a template, or to edit an existing template, select the template and click Edit a template
    The Mail Templates window.
  7. For new templates, set the name and base template of the new template.
    Select an existing template from the dropdown menu on which to base the template. Click OK.
  8. Edit the template text.
    The Edit Template window has four fields:
    Item Description
    Name The template name.
    HTML The HTML mail body. Click Insert Image to insert an image into the template. The selected image will be copied to the template directory. You may preview the template by clicking Preview.
    Text The plain text mail body. You may preview the template by clicking Preview.
    Access Check the option 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 that includes both the HTML and plain text versions of the mail body. The templates are rendered using Apache Velocity (for more information, see the Apache Velocity User Guide at A conditional statement only generates content if the condition matches. A foreach loop generates content for each iteration of the loop. Within a template, there are two predefined variables:

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

    To iterate over notifications, use a foreach loop:

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

    This declares a local $event variable that can be used within the for-each loop.

    The following conditional statements can be used in the templates:


    All statements are categorized in four parts: conditional, session information, time, and statistics.


    Use these tests in an if statement. For example:

    #if ($event.isFailed())
    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. Three outputs: "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.
    And use the counter $velocityCount in an if statement to limit the output file count. For example, to list only the first ten files:
    #foreach ($file in $event.getFiles())
     #if ($velocityCount > 10)
    $event.getMessage() The message entered in the notification's "Message" field.
    $event.getError() The error message.


    Statement Description
    $, "lang", "format") Formatting the date and time output. Enter three values in the parenthesis:
    • Replace var with the following two statements; for example, $event.getStartTime()
    • Replace lang with an abbreviate 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, 2010-03-26 16:19:01 PST .
    $event.getStartTime() The session start time.
    $event.getEndTime() The session end time.


    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 transferred.
    $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.
  9. Click OK to save your changes.

When configured, you can apply the notifications to a connection host or a transfer session. You can also customize the subject line of the notification emails. For details, see Using Transfer Notifications.