Skip to content
/ nofly Public

Nofly is a Rails gem which wraps communications about a particular event on an object in a manageable and scalable structure.

License

Notifications You must be signed in to change notification settings

jdbdnz/nofly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nofly

What is it?

Nofly takes your logic for emails and other notifications out of the controller and put it into its own context

Why would you do that?

When we send communications to users it is usually in response to an event. Users often have their own communications preferences (when/how/what).

This logic can easily become complicated and so I developed Nofly to abstract it and let the core application only worry about knowing what event happened to which object/record.

Example

class FooController < ApplicationController

  def bar
    @foo = Foo.create foo_params 
    Nofly.for(@foo).bar
  end

end

class FooNofly < Nofly::EventLibrary
  // check user preferences 
  // send emails, 
  // send push notifications
  // etc.
end

Installation

Add an autoload path for the directory you’ll keep your nofly config.autoload_paths += Dir[“#{config.root}/app/nofly”] to application.rb

Explain the name

Notifications shouldn’t be done on the fly, and Ruby gems already has a ‘Notifly’

About

Nofly is a Rails gem which wraps communications about a particular event on an object in a manageable and scalable structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages