Unicom360.WhatsApp.TemplateHeader (Unicom360 v0.1.0)

Copy Markdown View Source

A template recipient's header parameter.

TemplateHeader.text("Ada")
TemplateHeader.image("https://example.com/receipts/ZM-4821.png")
TemplateHeader.video("https://example.com/promo.mp4")
TemplateHeader.document("https://example.com/invoices/4821.pdf", "invoice-4821.pdf")

A text header is sent as a JSON string, a media header as {"type", "url", "filename"?}. A recipient may also give a plain string or a map in that shape.

Summary

Functions

A document header, with an optional file name shown to the recipient.

An image header.

A text header (the template's {{1}} in its header).

A video header.

Types

t()

@type t() :: %Unicom360.WhatsApp.TemplateHeader{
  filename: String.t() | nil,
  type: String.t(),
  url: String.t() | nil,
  value: String.t() | nil
}

Functions

document(url, filename \\ nil)

@spec document(String.t(), String.t() | nil) :: t()

A document header, with an optional file name shown to the recipient.

image(url)

@spec image(String.t()) :: t()

An image header.

text(value)

@spec text(String.t()) :: t()

A text header (the template's {{1}} in its header).

video(url)

@spec video(String.t()) :: t()

A video header.