diff --git a/app/models/observer/ticket/notification.rb b/app/models/observer/ticket/notification.rb index a98779cbd..93ecb7977 100644 --- a/app/models/observer/ticket/notification.rb +++ b/app/models/observer/ticket/notification.rb @@ -177,6 +177,7 @@ class Observer::Ticket::Notification < ActiveRecord::Observer params = { :ticket_id => ticket.id, :article_id => article.id, + :type => type, :data => data, } Delayed::Job.enqueue( Observer::Ticket::Notification::BackgroundJob.new( params ) ) diff --git a/app/models/observer/ticket/notification/background_job.rb b/app/models/observer/ticket/notification/background_job.rb index fac4d0369..5c1c621dd 100644 --- a/app/models/observer/ticket/notification/background_job.rb +++ b/app/models/observer/ticket/notification/background_job.rb @@ -2,6 +2,7 @@ class Observer::Ticket::Notification::BackgroundJob def initialize(params) @ticket_id = params[:ticket_id] @article_id = params[:article_id] + @type = params[:type] @data = params[:data] end def perform @@ -42,13 +43,12 @@ class Observer::Ticket::Notification::BackgroundJob recipient_list = '' notification_subject = '' recipients.each do |user| - OnlineNotification.add( - :type => type, + :type => @type, :object => 'Ticket', :o_id => ticket.id, :seen => false, - :created_by_id => UserInfo.current_user_id || 1, + :created_by_id => article.created_by_id || 1, :user_id => user.id, )