sendEmailFromInform

A Workflow Engine function that sends an action-specific email using a predefined email server.

This action differs from the standard sendEmail function as it does not require a CEvent object—it is “eventless” (see Eventless workflows). All of the required parameters are passed into the action via the workflow context.

This function is designed to be called using the sendToWorkflow function (WFE or Graze API call), which supplies the required parameters in the context of the call.

Note

A parameter that references CEvent fields will fail to substitute (as no CEvent is passed to the function). Any parameter that this action uses should reference workflowContext values for substitution.

Include line breaks in the message using $NL or <br> notation in the message argument, as shown in the example.

This function is available as a feature of the Add-ons v2.3.5 download and later.

This function is available for alert and Situation workflows.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function sendEmailFromInform takes the following arguments:

Name

Required

Type

Description

emailConfig

yes

string

Server Config Name from the Email Endpoints integration. It contains the connection information for your email server.

subject

yes

string

Subject of the inform email.

message

yes

string

Email message body. Supports macro substitution.

Example

To send an email via Graze:

  1. Add a workflow to the Alert Inform Engine that includes the sendEmailFromInform action (see screenshot, below).

    Ensure that message contents in the template are referencing workflowContext values and not CEvent values:

    sendEmailFromInform_example_screencap.png

    sendTo:

    $(workflowContext.sendTo)

    subject:

    New Incident $(workflowContext.incident_id) 

    message (line feeds have been added for clarity):

    Hi<br><br>
    A new Incident has been created : $(workflowContext.incident_id) : ${workflowContext.incidentDescription)<br><br>
    The incident is $(worklowContext.severity)<br><br>
    See the incident : $(workflowContext.incidentURL)<br><br>
    Moogsoft Observability Cloud
  2. Execute the Graze call (https://<server>/graze/v1/sendToWorkflow), including all the required attributes in the context parameter.

    • incident_id

    • sendTo

    • incidentDescripton

    • severity

    • incidentURL

    { 
    	"engine_name" : "Alert Inform Engine",
    	"workflow_name" : "Send Freeform Email",	
    	"context" : {
    		"sendTo" : "spike@moogsoft.com",
    		"incident_id" :  12345,
    		"incidentDescription" : "Application situation for APP001, 3 hosts have been affected",
    		"severity" : "Major",
    		"incidentURL" : "https://app.moogsoft.ai/incident/12345"
    	}
    }

    This results in an email with this subject:

    And the body: