Customize emails for monitoring alert

Abiquo will customize emails using template and properties files with the following priority:

  1. Localized files for US English, monitoringAlertTemplate_en_US.mustache and monitoringAlert_en_US.properties

  2. Files with no language code extension, such as monitoringAlertTemplate.mustache and monitoringAlert.properties

  3. System defaults, with content as shown in the examples below

The recipient of a monitoring alert email does not have to be a user of the platform, so the platform does not have details of the locale to offer localized versions.

  1. Log in to the Abiquo API Server as an administrator

  2. In the config folder, if there is no mail folder, create a mail folder and set the owner as the tomcat user

    /opt/abiquo/config/mail
  3. In the mail folder, create the following files

    1. Email file

      monitoringAlertTemplate_en_US.mustache

      <p>You are receiving this email because the alert <strong>{{name}}</strong> has been <strong>{{state}}</strong> at {{alertDate}}.</p> <h4>Alert description</h4> <p>{{description}}</p> <h4>Notified alarms</h4> <ul> {{#alarms}} <li><em>{{alarmName}}</em>: {{alarmDescription}} - <em>{{entityType}}<em>: {{entityName}}</li> {{/alarms}} </ul> <p>For further details, go to the {{{portalname}}} at: {{{portaladdress}}}</p>
    2. Properties file

      monitoringAlert_en_US.properties

      subject=Alert {0} has been {1} at {2} portalname=Abiquo console portaladdress={0}

       If you change the subject property, you must restart the Tomcat server to apply your changes

      1. The variable {1} represents the state of the alert as activated or deactivated 

      2. The variable {2} represents the timestamp of when the alert changed state

      3. In the properties file you can only set the subject, portalname and portaladdress.

  4. Optionally add custom variables and content

    1. In the email body, to add a custom variable, use double curly braces (also called double mustaches). For example

    2. Then in your properties file, set a value for your custom variable

       To return unescaped HTML as part of a template property, use the triple mustache, which is {{{ and }}}.
      The Mustache templating software that adds the property values will escape HTML variables in double mustaches by default.

  5. Change the owner of the files to the tomcat user

Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved