# `Unicom360.WhatsApp.TemplateRecipient`
[🔗](https://github.com/TechRode-Solution-Limited/unicom360-elixir/blob/v0.1.0/lib/unicom360/whatsapp/template_recipient.ex#L1)

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")]
    )

  * `to` (required) - the recipient's WhatsApp number.
  * `user_reference_id` - your reference for this recipient. A template send is safe to retry
    only when every recipient has one.
  * `header` - a `Unicom360.WhatsApp.TemplateHeader`, a string or a map.
  * `body` - a `Unicom360.WhatsApp.TemplateBody`, a list or a map.
  * `buttons` - a list of `Unicom360.WhatsApp.TemplateButton` (or maps).
  * `otp` - the code, for an `AUTHENTICATION` template.

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

# `t`

```elixir
@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
}
```

# `new`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
