Runbox.Scenario.OutputAction.Notification (runbox v7.0.1)

Parameters for output action Notification.

The resulting output action sends a notification.

Link to this section Summary

Types

t()

Notification

Link to this section Types

@type t() :: %Runbox.Scenario.OutputAction.Notification{
  aqls: map(),
  attachments: [map()] | nil,
  data: map(),
  direct_subscriptions: [map()] | nil,
  ids: [String.t()],
  metadata: map(),
  primary_asset: String.t() | nil,
  priority: :low | :medium | :high | String.t(),
  type: String.t() | atom()
}

Notification

  • :type - string, type of the notification
  • :data - map, data for the template evaluation
  • :primary_asset - string, optional, id of an asset that corresponds to this notification
  • :ids - list of asset ids, optional, to filter recipients, each recipient must have sufficient privileges to see all listed IDs
  • :aqls - map, AQLs which are evaluated, provide further context to the templates, and also can serve the same purpose as ids - filter recipients to only those who can see the whole result of the query. Key is the name of the AQL which can be used in the template. Value is a map with aql (the AQL query) and primary (whether the AQL should also be used to filter recipients) keys.
  • :priority - optional, defaults to :medium, can be :low, :medium, :high, only applicable to some channels
  • :metadata - map, optional, additional metadata which can be used in notification group subscriptions. Should adhere to the format specified in notification/spec.exs.
  • :direct_subscriptions - list of maps, subscriptions to be used additionally to the usual routing. Each map should have the following.
    • :user - map, user object to be used instead of Altworx object, should have notification.email and optionally even notification.language.
    • :templates - list of ids, which templates should be used
    • :channels - list of ids, which channels should be used
  • :attachments - list of maps, optional, attachments that should be sent with the notification. Each map has the following keys.
    • :data - binary, content of the attachment
    • :filename - string, name of the file
    • :content_type - string, optional, MIME type of the data
    • :type - whether the attachment is to inlined in the template (:inline) or not (:attachment, this is the default)