-
Notifications
You must be signed in to change notification settings - Fork 7
Add example of notifications #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Example how to implement notification system using multiple delivery system. In out example we use Email and Hipchat. There are two main things to learn: * SendFeedback interactor — the entry point * FeedbackNotification model — class to generate content of different type of notifications
notifications/README.md
Outdated
| private | ||
|
|
||
| def email | ||
| context.feedback.employee.email |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here is the violation of law of demeter. Probably, we can delegate email to feedback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArturMinnullin something like this?
delegate :email, to: context.feedback.employeeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timurvafin Yeap 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArturMinnullin check this out 603cecd
| gem "hipchat" | ||
| gem "interactor" | ||
| gem "render_anywhere" | ||
| gem "sidekiq" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to metion here that If sidekiq has not been added and configured before implementing this feature then it is required to set sidekiq as active job queue adapter in config/application.rb
# config/application.rb
# ...
class Application < Rails::Application
# ...
config.active_job.queue_adapter = :sidekiq
# ...
end
# ...
Example how to implement notification system using multiple delivery system.
In out example we use Email and Hipchat.
There are two main things to learn: