Skip to content

jdbdnz/nofly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

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

Add an autoload path for the directory you’ll keep your nofly config.autoload_paths += Dir to application.rb

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

 
 
 

Contributors

Languages