WhatsappElixir.Messages (whatsapp_elixir v0.1.9)
View SourceModule to handle WhatsApp messaging.
Summary
Functions
Marks a message as read.
Replies to a message with a given text.
Sends a text message.
## Parameters
template: The name of the template to be sent.recipient_id: The recipient's WhatsApp ID.components: A list of components (e.g., buttons, text) to include in the template message.lang: (Optional) The language code for the message. Defaults to"en_US".custom_config: (Optional) A list of custom configuration options for the HTTP request.
Examples
iex> send_template("hello_world", "+2547111111111")
{:ok, %{"status" => "sent"}}
iex> send_template("welcome_template", "+2547111111111"", [], "fr_FR" , custom_configs)
{:ok, %{"status" => "sent"}}Returns
{:ok, response}: On success, returns:okand the HTTP response.{:error, response}: On failure, returns:errorand the HTTP response.