Packages

Send voice verification code via Ronglianyun (容联云通讯)

Current section

Files

Jump to
ronglianyun lib ronglianyun.ex
Raw

lib/ronglianyun.ex

defmodule Ronglianyun do
use GenServer
# GenServer APIs
def start_link do
GenServer.start_link(__MODULE__, :ok, [name: __MODULE__])
end
# GenServer Callbacks
def handle_call({:send_to, {phone, content} = _opts}, _from, _state) do
{:reply, Ronglianyun.Query.to(phone, content), nil}
end
# APIs
def send(phone, content) do
GenServer.call(Ronglianyun, {:send_to, {phone, content}})
end
end