View Source Notifiex (Notifiex v1.2.0)

The main module for Notifiex.

Link to this section Summary

Functions

send helps in sending a notification through the specified service.

send_async helps in sending a notification in an asynchronous way.

send_async_multiple helps in sending multiple notifications in an asynchronous way.

send_multiple helps in sending multiple notifications in a synchronous way.

Returns a Keyword list of services.

Callback implementation for Application.start/2.

Link to this section Types

@type config() :: {service(), payload(), options()}
@type id() :: atom()
@type options() :: map()
@type payload() :: map()
@type result() :: {:ok, any()} | {:error, {atom(), any()}}
@type send_type() :: :sync | :async
@type service() :: atom()

Link to this section Functions

Link to this function

send(service, payload, options)

View Source
@spec send(service(), payload(), options()) :: result()

send helps in sending a notification through the specified service.

Example:

> Notifiex.send(:slack, %{text: "Notifiex is cool! 🚀", channel: "general"},  %{token: "SECRET"})
Link to this function

send_async(service, payload, options)

View Source
@spec send_async(service(), payload(), options()) :: result()

send_async helps in sending a notification in an asynchronous way.

Example:

> Notifiex.send_async(:slack, %{text: "Notifiex is cool! 🚀", channel: "general"},  %{token: "SECRET"})
Link to this function

send_async_multiple(notification)

View Source
@spec send_async_multiple(any()) :: [{id(), result()}]

send_async_multiple helps in sending multiple notifications in an asynchronous way.

Example:

notifs = [
  slack_test: {:slack, %{text: "Notifiex is cool! 🚀", channel: "general"},  %{token: "SECRET"}},
  discord_test: {:discord, %{content: "Notifiex is cool! 🚀"},  %{webhook: "SECRET"}}
]

Notifiex.send_async_multiple(notifs)
Link to this function

send_multiple(notification)

View Source
@spec send_multiple(any()) :: [{id(), result()}]

send_multiple helps in sending multiple notifications in a synchronous way.

Example:

notifs = [
  slack_test: {:slack, %{text: "Notifiex is cool! 🚀", channel: "general"},  %{token: "SECRET"}},
  discord_test: {:discord, %{content: "Notifiex is cool! 🚀"},  %{webhook: "SECRET"}}
]

Notifiex.send_multiple(notifs)
@spec services() :: keyword()

Returns a Keyword list of services.

Link to this function

start(start_type, start_args)

View Source

Callback implementation for Application.start/2.