Class: Decidim::Messaging::ConversationMailer

Inherits:
ApplicationMailer show all
Defined in:
app/mailers/decidim/messaging/conversation_mailer.rb

Overview

A custom mailer for sending notifications to users when they receive private messages

Instance Method Summary collapse

Instance Method Details

#comanagers_new_conversation(group, user, conversation, manager) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'app/mailers/decidim/messaging/conversation_mailer.rb', line 29

def comanagers_new_conversation(group, user, conversation, manager)
  notification_mail(
    from: group,
    to: user,
    conversation: conversation,
    message: conversation.messages.first.body,
    action: "comanagers_new_conversation",
    third_party: manager
  )
end

#comanagers_new_message(sender, user, conversation, message, manager) ⇒ Object



61
62
63
64
65
66
67
68
69
70
# File 'app/mailers/decidim/messaging/conversation_mailer.rb', line 61

def comanagers_new_message(sender, user, conversation, message, manager)
  notification_mail(
    from: sender,
    to: user,
    conversation: conversation,
    message: message.body,
    action: "comanagers_new_message",
    third_party: manager
  )
end

#new_conversation(originator, user, conversation) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/mailers/decidim/messaging/conversation_mailer.rb', line 8

def new_conversation(originator, user, conversation)
  notification_mail(
    from: originator,
    to: user,
    conversation: conversation,
    message: conversation.messages.first.body,
    action: "new_conversation"
  )
end

#new_group_conversation(originator, manager, conversation, group) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/mailers/decidim/messaging/conversation_mailer.rb', line 18

def new_group_conversation(originator, manager, conversation, group)
  notification_mail(
    from: originator,
    to: manager,
    conversation: conversation,
    message: conversation.messages.first.body,
    action: "new_group_conversation",
    third_party: group
  )
end

#new_group_message(sender, user, conversation, message, group) ⇒ Object



50
51
52
53
54
55
56
57
58
59
# File 'app/mailers/decidim/messaging/conversation_mailer.rb', line 50

def new_group_message(sender, user, conversation, message, group)
  notification_mail(
    from: sender,
    to: user,
    conversation: conversation,
    message: message.body,
    action: "new_group_message",
    third_party: group
  )
end

#new_message(sender, user, conversation, message) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'app/mailers/decidim/messaging/conversation_mailer.rb', line 40

def new_message(sender, user, conversation, message)
  notification_mail(
    from: sender,
    to: user,
    conversation: conversation,
    message: message.body,
    action: "new_message"
  )
end