Unicom360.WhatsApp.TemplateRecipient (Unicom360 v0.1.0)

Copy Markdown View Source

One recipient of a template send.

TemplateRecipient.new("260971234567",
  user_reference_id: "inv-42",
  header: TemplateHeader.image("https://example.com/receipts/ZM-4821.png"),
  body: TemplateBody.of(["Ada", "ZM-4821"]),
  buttons: [TemplateButton.url(0, "ZM-4821")]
)

A recipient may also be a plain map or keyword list with these keys.

Summary

Functions

Builds a recipient. opts takes :user_reference_id, :header, :body, :buttons and :otp.

Types

t()

@type t() :: %Unicom360.WhatsApp.TemplateRecipient{
  body: Unicom360.WhatsApp.TemplateBody.t() | list() | map() | nil,
  buttons: [Unicom360.WhatsApp.TemplateButton.t() | map()] | nil,
  header: Unicom360.WhatsApp.TemplateHeader.t() | String.t() | map() | nil,
  otp: String.t() | nil,
  to: String.t(),
  user_reference_id: String.t() | nil
}

Functions

new(to, opts \\ [])

@spec new(String.t(), keyword()) :: t()

Builds a recipient. opts takes :user_reference_id, :header, :body, :buttons and :otp.