Creating an action

In the simple story, we created an automation story that sends a HTTP POST request when an alert is related to an infection and the affected user's job is CEO. In this article we will expand the story by sending an email when the user's job is "engineer".

Creating an email action 

On the storyboard page, drag an email action from the library panel and drop it onto the storyboard. 

Setting the source action 

Next we need to define from where our new email action should receive events. We do this by linking them together. From the icon on the User is engineer action, drag the link into the new Email action action. 

Configuring the action 

On the right hand side of the storyboard page is the Action Properties Panel. Here we can configure how the action should perform.

Editing the options block 

In the properties panel, we will configure the granular operation of the action. For an Email Action, there are a number of options we can specify:

  • recipients: Include an email address (or an array of email addresses) to whom the email should be sent. Each recipient will receive an individual email.

  • subject: Include a subject for the email. Include information from upstream events by specifying the key.

  • body: (Optional) Customize the body of the email. Include information from upstream events by specifying the JSONPath (examples below). The body can contain simple HTML and will be sanitized. When using body, it will be wrapped with <html> and <body> tags, so these do not need to be added.

Note

Adding additional options 

You can access additional settings by clicking on the Add Option button at the bottom of the properties panel:

Adding values 

When editing or creating an action you can add data from preceding actions. Click on the data inserter and select "Value". Then in the popup window that appears enter the path to the data you want to insert. You can also reference Credentials, Resources and Meta data in this way.

Testing the Action 

There is now a new action ready to receive events from the "User is engineer" action (shown below). 

To test that this action is working as expected, we can "re‑emit" an event from the "User is engineer" events page.

Note

Viewing the events emitted by our new "Notify by email" action, we can see that the action ran and successfully emitted an event similar to the following. The corresponding email is also shown below.