Guardsix.Data.EmailNotification (guardsix v1.2.2)

Copy Markdown View Source

Builder for email notification structs.

Wraps the Email Notification for Alert Rules API. Start with Guardsix.email_notification/2 and pipe through the builder functions to set subject, template, and other options.

Summary

Types

t()

@type t() :: %Guardsix.Data.EmailNotification{
  disable_search_link: boolean() | nil,
  dispatch_option: String.t() | nil,
  email_emails: [String.t()],
  email_subject: String.t(),
  email_template: String.t(),
  ids: [String.t()],
  logo_enable: boolean() | nil,
  logo_type: String.t() | nil,
  logo_value: String.t() | nil,
  notify_email: boolean() | nil,
  simple_view: boolean() | nil,
  threshold_option: String.t() | nil,
  threshold_value: number() | nil
}

Functions

disable_search_link(notif, disabled)

dispatch_option(notif, option)

logo(notif, type, value)

new(ids, emails)

notify_email(notif, enabled)

simple_view(notif, enabled)

subject(notif, subject)

template(notif, template)

threshold(notif, option, value)

to_map(notif)

This function is deprecated. Use to_payload/1 instead.

Convert an EmailNotification struct into the flat map format expected by the Guardsix API.

to_payload(notif)

validate(notif)

@spec validate(t()) :: :ok | {:error, [String.t()]}