diff --git a/app/jobs/send_template_message_job.rb b/app/jobs/send_template_message_job.rb index 125ed3e0b..900e8b84d 100644 --- a/app/jobs/send_template_message_job.rb +++ b/app/jobs/send_template_message_job.rb @@ -37,6 +37,7 @@ class SendTemplateMessageJob < ApplicationJob issue = Issue.find_by_id(issue_id) return unless operator.present? && issue.present? # receivers = receivers.where.not(id: operator&.id) + receivers = User.where(id: receivers) receivers_string, content, notification_url = MessageTemplate::IssueAtme.get_message_content(receivers, operator, issue) Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, issue_id: issue.id}, 2, operator_id) when 'IssueChanged' @@ -235,6 +236,7 @@ class SendTemplateMessageJob < ApplicationJob pull_request = PullRequest.find_by_id(pull_request_id) return unless operator.present? && pull_request.present? # receivers = receivers.where.not(id: operator&.id) + receivers = User.where(id: receivers) receivers_string, content, notification_url = MessageTemplate::PullRequestAtme.get_message_content(receivers, operator, pull_request) Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, pull_request_id: pull_request.id}, 2, operator_id) when 'PullRequestChanged' diff --git a/app/services/atme_service.rb b/app/services/atme_service.rb index 29c4b127e..f93314e47 100644 --- a/app/services/atme_service.rb +++ b/app/services/atme_service.rb @@ -32,6 +32,6 @@ class AtmeService < ApplicationService else return end - SendTemplateMessageJob.perform_later(message_source, receivers, user.id, @atmeable.id) if Site.has_notice_menu? + SendTemplateMessageJob.perform_later(message_source, receivers.pluck(:id), user.id, @atmeable.id) if Site.has_notice_menu? end end