WIP diary comment subscriptions

This commit is contained in:
Mikel Maron 2016-10-03 15:04:22 -04:00
parent 05ad0a4f7d
commit 443080d7b0
8 changed files with 181 additions and 8 deletions

View file

@ -83,9 +83,10 @@ class Notifier < ActionMailer::Base
end
end
def diary_comment_notification(comment)
with_recipient_locale comment.diary_entry.user do
@to_user = comment.diary_entry.user.display_name
# FIXME mail should say your / their depending who's message it is
def diary_comment_notification(comment, recipient)
with_recipient_locale recipient do
@to_user = recipient.display_name
@from_user = comment.user.display_name
@text = comment.body
@title = comment.diary_entry.title
@ -108,7 +109,7 @@ class Notifier < ActionMailer::Base
:title => "Re: #{comment.diary_entry.title}")
mail :from => from_address(comment.user.display_name, "c", comment.id, comment.digest),
:to => comment.diary_entry.user.email,
:to => recipient.email,
:subject => I18n.t("notifier.diary_comment_notification.subject", :user => comment.user.display_name)
end
end