ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - zmoshansky/echo: A simple & highly extendable, meta-notification system; Echo checks notification preferences & dispatch notifications to different adapters (ex. email, logger, analytics, sms, etc.).
A simple & highly extendable, meta-notification system; Echo checks notification preferences & dispatch notifications to different adapters (ex. email, logger, analytics, sms, etc.). - zmos...
Visit Site

GitHub - zmoshansky/echo: A simple & highly extendable, meta-notification system; Echo checks notification preferences & dispatch notifications to different adapters (ex. email, logger, analytics, sms, etc.).

GitHub - zmoshansky/echo: A simple & highly extendable, meta-notification system; Echo checks notification preferences & dispatch notifications to different adapters (ex. email, logger, analytics, sms, etc.).

Echo - ECHO Echo echo...

A simple & highly extendable, meta-notification system; Echo checks notification preferences & dispatch notifications to different adapters (ex. email, logger, analytics, sms, etc.).

Build Status Hex.pm Hex.pm Github Issues Pending Pull-Requests

Description

Echo is designed to be highly adaptable to your notification needs through different adapters and per adapter hooks. A notification is dispatched with Echo.notify/2 which then calls on each registered adapter, requesting that it delivers the notification. Each adapter is passed an event_type, of your designation, and data that it may use to deliver the notification.

Config

Echo is easily configured. A possible sample configuration is given below. Custom Preferences & Adapters are easy to build, look at lib/echo/adapters/email & test/support/test_preferences.ex for examples. Hooks allow you to specify the module which implements @behaviour Echo.Hooks, which generates the adapter specific data needed to deliver a notification (see test/support/email_hook for an example); this might include: selecting the correct template, parsing data, or even nothing at all. Doing nothing allows unknown event types to be skipped by adapters.

config :echo, Echo,
  preferences: Echo.Preferences.AllowAll,
  adapters: [Echo.Adapters.Logger, Echo.Adapters.Email, YourApp.CustomAdapter],
  hooks: %{
    email: YourApp.EmailHook
  }

Architecture

Echo is somewhat like a pub-sub system; events are published, and adapters that are capable of handling them dispatch the notification accordingly. The intended flow is:

  • preferences module provides an ACL to check whether an event should be delivered on a particular adapter according to a user's preferences (ex. deny newsletters, but allow billing emails).
  • hooks provide a way to prepare arguments to an adapter based on the event_type & data. A hook can prevent it's adapter from delivering the notification if no data is returned. This means notifications are only sent for adapters that are configured to handle them, otherwise, they are harmlessly disregarded by that adapter.

ex.) In the code below, an email is sent for :user_register, but not :log_analytics; Adapter.Email will harmlessly skip it as an :unknown_event.

Echo.notify(:log_analytics, data)
...
Echo.notify(:user_register, data)
defmodule App.EmailHook
@behaviour Echo.Hooks

  def message(event_type, data) do
    ...
    template = case event_type do
      :user_register -> "emails/register.html.eex"
      :user_forgot_password -> "emails/forgot_password.html.eex"
      _ -> nil
    end
    ...
  end
end

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory