Giter Site home page Giter Site logo

Comments (3)

jonhue avatar jonhue commented on September 2, 2024 1

Sounds good.

from notifications-rails.

TylerRick avatar TylerRick commented on September 2, 2024

Something like this perhaps?

config.define_pusher :email: :ActionMailer, from: '[email protected]'
config.define_pusher :email: :SimpleMailer, from: '[email protected]'

config.define_pusher :push, :OneSignal, app_id: '...'

config.define_pusher :sms, :SMSEasy, app_id: '...'
config.define_pusher :sms, :TwilioSMS, app_id: '...'

config.define_pusher :fax, :DoPeopleStillUseFaxes, from: '123457890'
config.define_pusher :voicemail, :SomeTextToSpeechAutomatedDialerThing
config.define_pusher :carrier_pigeon, :PigeonGram
config.define_pusher :smoke_signal, :SmokeSignalsDotCom

(the names being service-agnostic names corresponding to different ways users could choose to receive notifications)

    def define_pusher(name, klass, options = {})
      pushers[name] = ::NotificationPusher::Pusher.new(klass, options)
    end

klass could be a constant symbol like the current API (would check for it under NotificationPusher:: first but still work for fully qualified constant name) or an actual constant.

Looks like this would be a breaking change...

Speaking of breaking changes, do you like the name Pusher? I think it's pretty good, but when you start talking about a "push" Pusher, it starts to sound a little bit silly/confusing. Just something to think about...

What about calling them DeliveryMethods? You can deliver notifications by email, SMS, push, etc. But is it accurate to say you push notifications via any option you can imagine? It's also what ActionMailer calls its option, not that we have to copy them.

from notifications-rails.

jonhue avatar jonhue commented on September 2, 2024

I think we can go with that. I also like the idea of renaming Pusher to DeliveryMethod. As far as I can see, this change wouldn't even require the 'pushers' itself to change. They only depend on NotificationPusher.

from notifications-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.