View Source SmsUp.Sender (sms_up v1.3.5)

SMS sender api that can accept a configurable deliver for sending successfull messages.

Summary

Functions

Send a sms with the chosen Sender Module with an international formated number.

Functions

Link to this function

deliver(number, text, options)

View Source
@spec deliver(String.t(), String.t(), Keyword.t()) ::
  {:ok, %{body: String.t(), to: String.t(), options: Keyword.t()}}
  | {:error, String.t()}
Link to this function

send_sms(number, text, options \\ [])

View Source
@spec send_sms(String.t(), String.t(), Keyword.t()) ::
  {:ok, %{body: String.t(), to: String.t(), options: Keyword.t()}}
  | {:error, String.t()}

Send a sms with the chosen Sender Module with an international formated number.

Configuration is available as : config :sms_up, deliver_module: MODULE

MODULE can be:

  • SmsUp.Delivery.LoggerDelivery (default)
  • SmsUp.Delivery.SmsUpDelivery.

Returns a ok tuple containing the message body and the number for which it was sent to or an error tuple with the reason.

Examples

iex> SmsUp.send_sms("+41765556677", "message", [])
{:ok, %{to: "+41765556677", body: "message", options: []}}

iex> SmsUp.send_sms("Hello", "FR", [])
{:error, "Hello is not a valid number"}