SmsUp.Delivery.SmsUpDelivery (sms_up v1.4.1)
View SourceDeliver the sms throught SMS Up plateform with your API key.
Summary
Functions
Deliver the SMS to the real API. Provide a valid international number, the body of the message and a optional list of options
Functions
@spec deliver(String.t(), String.t(), Keyword.t()) :: {:ok, %{body: String.t(), to: String.t(), options: Keyword.t()}} | {:error, String.t()}
Deliver the SMS to the real API. Provide a valid international number, the body of the message and a optional list of options:
- pushtype: The push type (alert or marketing)
- delay: Sending date Y-m-d H:i:s
- sender: Allows you to customize the sender
- gsmsmsid: An id of your choice to link it to its delivery report
Can return the following errors from SMS UP:
- Authentication error
- XML error
- Not enough credits
- Incorrect date delay
- Contact list error
- JSON error
- Data error
- Your campaign is currently under moderation
- Unknown error
Do not forget to indicate your API key in config:
config :sms_up, api_key: MY_KEY
Examples
iex> SmsUp.Delivery.SmsUpDelivery.deliver("+41765556677", "Hello")
{:ok, %{to: "+41765556677", body: "Hello", options: []}}
iex> SmsUp.Delivery.SmsUpDelivery.deliver("+41765556677", "Hello", [sender: "Company"])
{:ok, %{to: "+41765556677", body: "Hello", options: [sender: "Company"]}}