Redwood Documentation

Product Documentation

 

›Email Alert Gateways

RunMyJobsAlerting

Triggering Alerts

  • Active Monitoring Module
  • Triggering Alerts
  • Process Alert Sources
  • Raising Alerts and Notifications from Processes
  • Process Server Alert Sources
  • Raising Alerts and Notifications from Process Servers
  • Ad Hoc Alert Sources
  • Using Ad Hoc Alert Sources
  • Monitor Alert Sources

Escalation Routes

  • Defining Escalation Routes

Email Alert Gateways

  • Email Alert Gateways
  • Creating and Configuring Email Alert Gateways

Alerting Routes

  • Visualizing Alerting Routes
← Email Alert GatewaysVisualizing Alerting Routes →

Creating and Configuring Email Alert Gateways

Alerting gateways specify the addressee as well as the content of the message that is to be sent to the recipients. When you configure multiple alert gateways, you must pay attention to the pattern you use as well as the processing order of each email gateway. The most specific address patterns must have the lowest processing order, or the wrong email gateway might be used. For example, an email gateway with an Address Pattern of *example.com and a processing order of 1 will take precedence over any other email gateway for example.com, like de.example.com or us.example.com if their processing order is greater than 1. Redwood recommends using a catch-all gateway with an extremely high processing order, like 99, to ensure all emails are sent.

You use multiple alert gateways in the following cases:

  • you want to tailor the email for a specific audience and the conditional expressions as outlined below prove complex to implement.
  • you want to use a different Alert Resend Delay, Alert Rate Interval, or Alert Rate Limit for the recipients.

Note that the gateway with the lowest processing order, that has a matching address pattern will be used. In the case that there are multiple gateways with the same processing order that have matching address patterns, then the gateway used will be non-determined.

Email Addresses and Aliases

The value of the Email Address field specified on the alert source is used to determine the email alert gateway and the addressee(s). You specify either an email address or an alias, such as alias:operators. When you specify an alias in the Email Address field, the alias is used to lookup the email alert gateway, only, and will not be used as a recipient address.

The list of recipients should be maintained on the email alert gateway on the Headers and/or Email tabs; if an email address was specified in the Email Address field of the alert source (it does not start with alias: ), this will be added as well. Multiple headers with the same name are supported, Redwood Server will combine them all to one.

Note that if you specify an Alert Source Email (email body) on the alert source, it will override any Email (email body) set on the email alert gateway.

The following table provides a few examples; for simplicity, it is assumed that the email alert gateway Address Pattern matches the value of the alert source Email Address field.

Alert Source - Email Address FieldAlert Source - Email TabEmail Alert Gateway - Headers TabEmail Alert Gateway - Email TabResult
alias:development<none defined>to:jdoe@example.comto:jsmith@example.comcc:emustermann@example.comto:cberthier@example.comto:jdoe@example.com, jsmith@example.com, cberthier@example.comcc:emustermann@example.com
cberthier@example.comto:jsmith@example.comto:jdoe@example.comcc:emustermann@example.comto:cberthier@example.com, jsmith@example.com, jsmith@example.com

Customizing Emails

You can customize emails on the Email tab, using the following two constructs:

  • conditional evaluation
  • REL expressions (without the equals (=))

Conditional Evaluation

[?if test="expression"?]
text
[?endif?]

REL Expressions

[?=expression?]

Example

<html>
<head><title>[?=alertSourceType?] Email</title></head>
<body>
[?if test="alertSourceType === 'AdHocAlertSource'"?]
Ad-hoc alert: [?=data?]
[?endif?]
[?if test="alertSourceType === 'ProcessServerAlertSource'"?]
Process server alert: [?=oldStatus?]  =&gt; [?=newStatus?]
[?endif?]

Link <a
href="http://prd1.example.com:50200/redwood/api-permalink/show?link-objecttype=[?=alertSourceType?]&link-uniqueid=[?=alertSourceUniqueId?]">alert source</a>
</body>
</html>

Note that the available objects for use in these expressions depend on the alert source as well as the raiser. For example, a JDBC job does not have a remote status; when it triggers a process alert source and the alert source, the escalation or gateway attempt to use the remoteStatus variable, the active monitoring module will produce an error. Another example would be the process server alert source which does not have a queue variable; if an alert source, escalation, or gateway were to use this variable for an alert caused by a process server alert source, the active monitoring module would produce an error. For these situations, you have the conditional expressions to verify the cause of the alert prior to using variables.

You can find all available variables in the following topics:

  • process Alert Sources
  • Monitor Alert Sources
  • Process Server Alert Sources
  • Ad Hoc Alert Sources

Email Alert Gateway Actions

Email alert gateway actions allow you to customize the email and perform specific tasks before it is sent using RedwoodScript. You can, for example, cancel it under specific circumstances.

Procedure

Setting up email

  1. Navigate to "Definitions > Processes".
  2. Choose Submit from the context-menu of System_Mail_Configure.
  3. Specify only the From address if you do not know the address of the SMTP server. The process will attempt to detect the appropriate mail server to use automatically.
  4. Check the status of the process in "Monitoring > Processes".

If the process ends in status Completed then the mail server has successfully been detected and stored.

If the process ends in status Error, the mail server could not be automatically detected. You should look at the log file for more information. You can re-run the process and specify the mail server to use. You should ask your system or network administrator for the name or IP address of your SMTP mail server.

Creating an email gateway

  1. Navigate to "Alerting > E-Mail Alert Gateways".
  2. Choose New Email Alert Gateway from the context-menu.
  3. Fill in the fields Name, Address Pattern and Processing Order.
  4. Optionally set custom headers on the Headers and specify files to attach on the File Attachments tab.
  5. Choose Save & Close.

Example

Creating an email gateway for example.com

  1. Navigate to "Alerting > E-Mail Alert Gateways".
  2. Choose New Email Alert Gateway from the context-menu.
  3. Fill in the fields Name, fill *@example.com into the Address Pattern and 99 into Processing Order.
  4. On the Headers tab, choose Add and fill From into the Name field and prd-operators@example.com into the Value field.
  5. On the Headers tab, choose Add and fill subject into the Name field and prd-process failed: ${subject}.
  6. On the File Attachments tab choose Add, enter stderr.log into the Name field, choose Add again and enter stdout.log into the Name field.
  7. Choose Save & Close.

You want to wait until the second run of the process has failed before you send alerting emails, this is done by suppressing the first email and operator message in the alert gateway action:

{
  // Get the alert information
  Alert alert = jcsEmailAlertGatewayPreSendActionContext.getAlert();
  OperatorMessage omessage = alert.getOperatorMessage();
  SchedulerEntity sentity = omessage.getSenderObject();

  // Do not send emails for the first failure
  if (sentity instanceof Job)
  {
    Job process = (Job) sentity;

    // If RestartJobId is null, then this is the first process.
    if (process.getStatus().getState() == JobStatusState.Final && null == process.getRestartJobId())
    {
      // Suppress sending the email
      jcsEmailAlertGatewayPreSendActionContext.setSend(false);

      // Reply to and delete the operator message
      omessage.setReply("Acknowledge");
      omessage.deleteObject();
    }
  }
}

See Also

Email Alert Gateways

← Email Alert GatewaysVisualizing Alerting Routes →
  • Email Addresses and Aliases
  • Customizing Emails
  • Email Alert Gateway Actions
  • Procedure
  • Example
  • See Also
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |