Skip to content

Notification Connector

The Notification connector delivers payloads as messages to external channels. The message body is either the JSON-marshalled payload or a string rendered from a Go text/template.

Connector Type: MeddleNotification

Supported Channels: slack, teams, email, microsoft365, webhook

  • channel (required): One of slack, teams, email, microsoft365, webhook
  • template: Optional Go text/template string. Payload fields are accessible as {{ .field }}. If empty, the payload is JSON-encoded.
  • webhookUrl: Target URL (used by the webhook channel)
  • slackConfig: Slack-specific options
  • teamsConfig: Teams-specific options
  • emailConfig: SMTP email options
  • microsoft365Config: Microsoft Graph API options
{
"type": "MeddleNotification",
"config": {
"channel": "slack",
"template": "Temperature alert: {{ .temperature }}°C on sensor {{ .sensor_id }}",
"slackConfig": {
"botToken": "xoxb-...",
"channel": "#alerts"
}
}
}

slackConfig fields:

  • botToken (required): Slack bot user OAuth token
  • channel (required): Channel ID or name (e.g. #alerts)
{
"type": "MeddleNotification",
"config": {
"channel": "teams",
"template": "Machine {{ .machine_id }} stopped. Status: {{ .status }}",
"teamsConfig": {
"webhookUrl": "https://outlook.office.com/webhook/..."
}
}
}

teamsConfig fields:

  • webhookUrl (required): Incoming webhook URL configured in Teams
{
"type": "MeddleNotification",
"config": {
"channel": "email",
"template": "Alert from sensor {{ .sensor_id }}: {{ .message }}",
"emailConfig": {
"smtpHost": "smtp.example.com",
"smtpPort": 587,
"from": "alerts@example.com",
"to": ["ops@example.com", "manager@example.com"],
"username": "alerts@example.com",
"password": "app-specific-password"
}
}
}

emailConfig fields:

  • smtpHost (required), smtpPort (required)
  • from (required, must be a valid email)
  • to (required, min 1 recipient)
  • username, password: Optional SMTP authentication

Sends mail via Microsoft Graph using OAuth2 client credentials. Requires an Azure AD app registration with the Mail.Send application permission (admin-consented).

{
"type": "MeddleNotification",
"config": {
"channel": "microsoft365",
"template": "Production halted on line {{ .line_id }}",
"microsoft365Config": {
"tenantId": "00000000-0000-0000-0000-000000000000",
"clientId": "11111111-1111-1111-1111-111111111111",
"authMethod": "secret",
"clientSecret": "your-client-secret",
"fromAddress": "alerts@yourtenant.onmicrosoft.com",
"to": ["ops@yourtenant.onmicrosoft.com"],
"subject": "Production Alert",
"saveToSentItems": true
}
}
}

microsoft365Config fields:

  • tenantId (required), clientId (required)
  • authMethod: secret (default) or certificate
  • clientSecret: Required when authMethod is secret
  • certificate: Required when authMethod is certificate. Provide either certificateFile + privateKeyFile (PEM) or pfxFile (+ optional pfxPassword).
  • fromAddress (required, must be a valid email matching a licensed mailbox)
  • to (required, min 1 recipient)
  • subject: Email subject (default Meddle Notification)
  • saveToSentItems: When true, the message is saved in the mailbox’s Sent Items
{
"type": "MeddleNotification",
"config": {
"channel": "webhook",
"webhookUrl": "https://hooks.example.com/incoming",
"template": "{{ .machine_id }}: {{ .status }}"
}
}

Posts a JSON body { "message": "...", "data": { ...payload... } } to webhookUrl.

Templates use Go’s text/template syntax. Common patterns:

Temperature: {{ .temperature }}°C
{{ if gt .pressure 100.0 }}Pressure HIGH{{ end }}
Sensor {{ .sensor_id }} reported {{ .status }} at {{ .timestamp }}

If no template is configured, the full payload is JSON-encoded as the message.

  1. Operator notifications for threshold violations
  2. Incident routing to on-call channels via Slack or Teams
  3. Audit logging via webhook to a SIEM or HTTP endpoint
  4. Corporate email alerts with Microsoft 365 OAuth (no SMTP password required)
  • Use templates to keep messages short, human-readable, and actionable
  • Place Trigger or Rate Limiter upstream to avoid flooding channels
  • For Microsoft 365, prefer certificate auth in production; rotate secrets regularly
  • Use a webhook channel when sending to internal systems that do not need a specific provider integration
  • Alert - Stateful alerting with duration and cooldown
  • Trigger - Gate notifications on a condition
  • Rate Limiter - Cap notification frequency