ExSlackNotifier
It's based on Elixir-Slack.
Currentry, supported only chat.postMessage API.
Installation
In your mix.exs
def deps do
[
{:ex_slack_notifier, "~> 0.1.0"}
]
end
In your config/config.exs
config :ex_slack_notifier, :api_token, "YOUR TOKEN"
# OR
config :ex_slack_notifier, :api_token, {:system, "SLACK_API_TOKEN"}Usage
ExSlackNotifier.build()
|> ExSlackNotifier.put(:token)
|> ExSlackNotifier.put(:username, "Hello")
|> ExSlackNotifier.append(
:attachments,
ExSlackNotifier.Attachment.build()
|> ExSlackNotifier.Attachment.put(:color, "good")
|> ExSlackNotifier.Attachment.append(:fields, %{title: "This is a field", value: "the value"})
)
|> ExSlackNotifier.post_message("#random", "Test message from ex_unit")