Email

Send critical email alerts to key stakeholders

Overview

The Email transport provides the ability to send alerts as an email which can drive further processing.

Example & DSL attributes

This example configures the Email transport to send IoT status notifications to a single recipient using the mailtrap solution.

email publisher:
  name: iot_email_notification
  email:
    subject: IoT Valve Notification
    message template: Toggling sensor {sensorId} humidifier valve state to {state} (1:ON | 0:OFF)
    from: sender@domain.com
    recipients:
      - recipient@domain.com

  smtp:
    host: sandbox.smtp.mailtrap.io
    port: 25
    enable auth: true
    enable starttls: true
    ssl trust: sandbox.smtp.mailtrap.io

Attributes schema

Attribute
Description
Data Type
Required

name

Logical name for the configuration

String

email

Configure the message with template and recipients etc;

smtp

Configure the SMTP service

Email attributes schema

Attribute
Description
Data Type
Required

subject

Slack api bot token. This is provided either within the configuration file or as the SLACK_API_TOKEN environment variable.

String

message template

Message template that applies the selected attributes from an emitted event to the message i.e. {sensorId} is replaced by the corresponding value in the event. Note HTML can be embedded within the template for richer email content.

String

from

Valid from email address. Often this will be a system level email address

String

recipients

List of valid recipient email addresses

List

recipient type

Optional attribute to send the email as 'TO', 'CC' or 'BCC'

String Default: TO

content type

Optional message content type. Default:

text/html; charset=utf-8

String

SMTP attributes schema

SMTP service authentication username and password credentials are provided as system environment variables not within the DSL. Required variables to set within the executing environment:

JOULE_SMTP_USERNAME=xxxxxx JOULE_SMTP_PASSWORD=xxxxxx

Attribute
Description
Data Type
Required

host

smtp service host address

String

port

SMTP port

Integer Default: 25

ssl trust

Address of the SSL trust service

String

enable auth

Enable user to authenticate before sending an email

Boolean Default: true

enable starttls

Enable starttle protocol for all email traffic

Boolean Default: true

Last updated

Was this helpful?