Sha256: 9085da8afc4639ee6cb5e5a49e8e963b2baeaa2591540dcc812a6bded5a8ba1c
Contents?: true
Size: 1.17 KB
Versions: 21
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true module Decidim module Messaging # A custom mailer for sending notifications to users when they receive # private messages class ConversationMailer < Decidim::ApplicationMailer def new_conversation(originator, user, conversation) notification_mail( from: originator, to: user, conversation: conversation, action: "new_conversation" ) end def new_message(sender, user, conversation) notification_mail( from: sender, to: user, conversation: conversation, action: "new_message" ) end private def notification_mail(from:, to:, conversation:, action:) with_user(to) do @organization = to.organization @conversation = conversation @sender = from.name @recipient = to.name @host = @organization.host subject = I18n.t( "conversation_mailer.#{action}.subject", scope: "decidim.messaging", sender: @sender ) mail(to: to.email, subject: subject) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems