mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 05:34:53 +08:00
39 lines
719 B
Ruby
39 lines
719 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# To deliver this notification:
|
||
|
#
|
||
|
# ActivityNotification.with(post: @post).deliver_later(current_user)
|
||
|
# ActivityNotification.with(post: @post).deliver(current_user)
|
||
|
|
||
|
class ActivityNotification < Noticed::Base
|
||
|
# Add your delivery methods
|
||
|
#
|
||
|
deliver_by :database
|
||
|
# deliver_by :email, mailer: "UserMailer"
|
||
|
# deliver_by :slack
|
||
|
# deliver_by :custom, class: "MyDeliveryMethod"
|
||
|
|
||
|
# Add required params
|
||
|
#
|
||
|
# param :post
|
||
|
|
||
|
def message
|
||
|
# if params[:legacy]
|
||
|
params[:message]
|
||
|
#else
|
||
|
# new logic
|
||
|
# end
|
||
|
end
|
||
|
|
||
|
def title
|
||
|
# if params[:legacy]
|
||
|
params[:title]
|
||
|
# else
|
||
|
# new logic
|
||
|
# end
|
||
|
end
|
||
|
# def url
|
||
|
# post_path(params[:post])
|
||
|
# end
|
||
|
end
|