Sha256: d7d78d43a5eb226848cfa131c7c17a8895e8a61aa2006a10498190bcf2c23b09
Contents?: true
Size: 1.12 KB
Versions: 14
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true module Decidim # A wrapper for preparing push notifications messages from conversations # It respects the same contract as the Decidim::Messaging::ConversationMailer class PushNotificationMessageSender include HasConversations def deliver SendPushNotification.new.perform(@notification, title) end private # rubocop:disable Metrics/ParameterLists # rubocop:disable Lint/UnusedMethodArgument # # There are some parameters thar are not used in the method, but they are needed to # keep the same contract as the Decidim::Messaging::ConversationMailer def send_notification(from:, to:, conversation:, action:, message: nil, third_party: nil) @action = action @sender = to @third_party = third_party @notification = PushNotificationMessage.new( recipient: to, conversation:, message: ) self end # rubocop:enable Lint/UnusedMethodArgument # rubocop:enable Metrics/ParameterLists def title get_subject(action: @action, sender: @sender, third_party: @third_party) end end end
Version data entries
14 entries across 14 versions & 1 rubygems