**Twilex is an Elixir Client to send SMS/MMS using Twilio. **
If available in Hex, the package can be installed as:
-
Add twilex to your list of dependencies in
mix.exs
:def deps do [{:twilex, "~> 0.0.1"}] end
-
Ensure twilex is started before your application:
def application do [applications: [:twilex]] end
Add the following to your config.exs
file:
config :twilex,
sid: "YOUR_TWILIO_SID",
token: "YOUR_TWILIO_AUTH_TOKEN"
Twilex.Messenger.create("from_number", "to_number", "body_text", "optional_media_url")
i.e.
iex(1)> Twilex.Messenger.create("15005550006", "15005550001", "test text")