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- aUnicom360.WhatsApp.TemplateHeader, a string or a map.body- aUnicom360.WhatsApp.TemplateBody, a list or a map.buttons- a list ofUnicom360.WhatsApp.TemplateButton(or maps).otp- the code, for anAUTHENTICATIONtemplate.
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
@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 }