2016-03-19 20:20:07 +02:00
|
|
|
class NotificationMailer < ApplicationMailer
|
|
|
|
helper StreamEntriesHelper
|
|
|
|
|
|
|
|
def mention(mentioned_account, status)
|
|
|
|
@me = mentioned_account
|
|
|
|
@status = status
|
|
|
|
|
2016-10-07 14:17:56 +03:00
|
|
|
return unless @me.user.settings(:notification_emails).mention
|
2016-03-19 20:20:07 +02:00
|
|
|
mail to: @me.user.email, subject: "You were mentioned by #{@status.account.acct}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def follow(followed_account, follower)
|
|
|
|
@me = followed_account
|
|
|
|
@account = follower
|
|
|
|
|
2016-10-07 14:17:56 +03:00
|
|
|
return unless @me.user.settings(:notification_emails).follow
|
2016-03-19 20:20:07 +02:00
|
|
|
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
|
|
|
|
|
2016-10-07 14:17:56 +03:00
|
|
|
return unless @me.user.settings(:notification_emails).favourite
|
2016-03-19 20:20:07 +02:00
|
|
|
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
|
|
|
|
|
2016-10-07 14:17:56 +03:00
|
|
|
return unless @me.user.settings(:notification_emails).reblog
|
2016-03-19 20:20:07 +02:00
|
|
|
mail to: @me.user.email, subject: "#{@account.acct} reblogged your status"
|
|
|
|
end
|
|
|
|
end
|