about summary refs log tree commit diff
path: root/app/mailers/notification_mailer.rb
blob: 1414c229572d59f66dd6c0e98ed504124492bfdc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class NotificationMailer < ApplicationMailer
  helper StreamEntriesHelper
  helper AtomBuilderHelper

  def mention(mentioned_account, status)
    @me     = mentioned_account
    @status = status

    mail to: @me.user.email, subject: "You were mentioned by #{@status.account.acct}"
  end

  def follow(followed_account, follower)
    @me      = followed_account
    @account = follower

    mail to: @me.user.email, subject: "#{@account.acct} is now following you"
  end

  def favourite(target_status, from_account)
    @me      = target_status.account
    @account = from_account
    @status  = target_status

    mail to: @me.user.email, subject: "#{@account.acct} favourited your status"
  end

  def reblog(target_status, from_account)
    @me      = target_status.account
    @account = from_account
    @status  = target_status

    mail to: @me.user.email, subject: "#{@account.acct} reblogged your status"
  end
end