Sha256: 9e8d3ea974e5ef1a35f728bde0dca158defa00681509b652c4832b0eca8a2eb3
Contents?: true
Size: 832 Bytes
Versions: 3
Compression:
Stored size: 832 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals class NotifyProposalsMentionedJob < ApplicationJob def perform(comment_id, linked_proposals) comment = Decidim::Comments::Comment.find(comment_id) linked_proposals.each do |proposal_id| proposal = Proposal.find(proposal_id) recipient_ids = proposal.notifiable_authors.map(&:id) Decidim::EventsManager.publish( event: "decidim.events.proposals.proposal_mentioned", event_class: Decidim::Proposals::ProposalMentionedEvent, resource: comment.root_commentable, recipient_ids: recipient_ids, extra: { comment_id: comment.id, mentioned_proposal_id: proposal_id } ) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems