Unicom360.WhatsApp.TemplateButton (Unicom360 v0.1.0)

Copy Markdown View Source

A template recipient's button parameter.

TemplateButton.url(0, "ZM-4821")         # the dynamic part of a URL button
TemplateButton.quick_reply(0, "rate-5")  # a quick-reply button's payload

Sent as {"index", "type", "value"}. A recipient may also give a map in that shape.

Summary

Functions

A quick-reply button: value is the payload returned when it is tapped.

A URL button: value fills the button's URL variable.

Types

t()

@type t() :: %Unicom360.WhatsApp.TemplateButton{
  index: non_neg_integer(),
  type: String.t(),
  value: String.t()
}

Functions

quick_reply(index, value)

@spec quick_reply(non_neg_integer(), String.t()) :: t()

A quick-reply button: value is the payload returned when it is tapped.

url(index, value)

@spec url(non_neg_integer(), String.t()) :: t()

A URL button: value fills the button's URL variable.