ExMicrosoftTeams (ex_microsoft_teams v0.1.1)

Documentation for ExMicrosoftTeams.

Link to this section Summary

Functions

Dynamically build client from a incoming webhook_url.

Send a message to a specific channel accordingly the client

Send a message to a specific channel accordingly the webhook_url

Link to this section Types

Link to this opaque

client()

(opaque)
@opaque client()

Link to this section Functions

Link to this function

client(webhook_url)

@spec client(String.t()) :: client()

Dynamically build client from a incoming webhook_url.

examples

Examples

iex> ExMicrosoftTeams.client("https://acme.webhook.office.com/webhookb2/abc/IncomingWebhook/123/456") %Tesla.Client{

 fun: nil,
 pre: [
   {Tesla.Middleware.BaseUrl, :call,
    ["https://acme.webhook.office.com/webhookb2/abc/IncomingWebhook/123/456"]},
   {Tesla.Middleware.Headers, :call, [[{"Content-Type", "application/json"}]]},
   {Tesla.Middleware.JSON, :call,
    [[engine: Jason, engine_opts: [keys: :atoms]]]}
 ],
 post: [],
 adapter: nil

}

Link to this function

notify(client, message)

@spec notify(client(), String.t()) :: {:ok, String.t()} | {:error, String.t()}

Send a message to a specific channel accordingly the client

examples

Examples

iex> client = ExMicrosoftTeams.client("https://acme.webhook.office.com/webhookb2/abc/IncomingWebhook/123/456") iex> ExMicrosoftTeams.notify(client, "Hello World!")

Link to this function

send_message(webhook_url, message)

@spec send_message(String.t(), String.t()) :: {:ok, String.t()} | {:error, String.t()}

Send a message to a specific channel accordingly the webhook_url

examples

Examples

iex> ExMicrosoftTeams.send_message("https://acme.webhook.office.com/webhookb2/abc/IncomingWebhook/123/456", "Hello World!!")
{:ok, "1"}