Can I define an email template for Event Rules?


THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • EFT Server (All Versions)

QUESTION

Can I define an email template for Event Rules?

ANSWER

The Conditions and Actions for every Event Rule you create, including email notifications, is saved in EFT Server's configuration file. Each time the EFT Administrator connects, it reads in the configuration file. Multiple Event Rules and email notifications can grow the configuration file quite large. If you expect to have numerous email notifications that are basically the same (e.g., you have default text that you always want to appear in the body of the email), you can define the body of the email in an HTML file, then reference it in the body of the Edit Mail Template dialog box.

To create an email notification template

  1. Create an HTML document that contains the text that will be the body of the email notification. You can include any HTML tags and the EFT Server context variables. For example:

    <HTML>

    <P>This message was sent to you automatically by GlobalSCAPE EFT Server on the following event: %EVENT.NAME%.</p>

     <TABLE>

    <TR>

    <TD>Server Local Time:</TD>

    <TD>%EVENT.TIME%</TD>

    </TR>

    <TR>

    <TD>Logon Name:</TD>

    <TD>%USER.LOGIN%</TD>

    </TR>

    <TR>

    <TD>Email Address:</TD>

    <TD>%USER.EMAIL%</TD>

    </TR>

    <TR>

    <TD>Home Folder:</TD>

    <TD>%USER.HOME_FOLDER%</TD>

    </TR>

    </TABLE>

    </HTML>

    Tip: You could define the email in an Edit Mail Template dialog box to easily add each of the context variables that you want, then copy and paste the body of the dialog box into a text file, and save it with an htm extension.  Be sure to include the opening and closing <html> and <body> tags.

    (You do not have to format the email with a table. The design of your email is only limited by your knowledge of HTML.)

  2. Save the file in a location that can be accessed by EFT Server. For example, name the file MailActionTemplate.htm, and save it in C:\Program Files\GlobalSCAPE\EFT. (If you are logging into EFT Server over an Active Directory Site, the Event Rule engine is running as that logged-in user, so the user account must have access to the template.)
  3. Define the Event Rule and add the email notification, then open the Edit Mail Template dialog box.

  4. In the body of the email, type file:// and the path to the email template, then click OK. For example, type:
  5. file://C:\Program Files\GlobalSCAPE\EFT\MailActionTemplate.htm

    IMPORTANT: There can be no spaces or line breaks before or after the link!

  6. Click Apply to save the Event Rule on the Server.

The referenced HTML file will appear in the body of the email that is triggered by EFT Server.