Send a chat message with Thinwrap (Elixir)

Post a chat message via :thinwrap_notifications.send_chat/2 in Elixir — one call shape for Slack, Discord, Teams and every other provider.

1. Install

{:thinwrap_notifications, "~> 1.2"}

2. Send the call

config = %{provider: :slack, webhook_url: System.fetch_env!("SLACK_WEBHOOK_URL")}

case :thinwrap_notifications.send_chat(config, %{body: "Deploy finished for build 1042."}) do
  {:ok, %{status: status, provider_message_id: id}} ->
    IO.puts("#{status} #{id}")

  {:error, %{code: code, message: message}} ->
    IO.puts("#{code}: #{message}")
end

Same code works for all supported providers — just change the provider ID.