2012-07-03 18:59:50 +02:00
|
|
|
class EmailReply < ActionMailer::Base
|
2013-06-30 08:29:51 +02:00
|
|
|
default :from => "#{Rails.application.name} " <<
|
|
|
|
"<nobody@#{Rails.application.domain}>"
|
2012-07-03 18:59:50 +02:00
|
|
|
|
|
|
|
def reply(comment, user)
|
2013-02-14 01:50:51 +01:00
|
|
|
@comment = comment
|
2012-07-03 18:59:50 +02:00
|
|
|
@user = user
|
|
|
|
|
2013-06-30 08:29:51 +02:00
|
|
|
mail(
|
|
|
|
:to => user.email,
|
|
|
|
:subject => "[#{Rails.application.name}] Reply from " <<
|
|
|
|
"#{comment.user.username} on #{comment.story.title}"
|
|
|
|
)
|
2012-07-03 18:59:50 +02:00
|
|
|
end
|
2012-09-10 19:40:33 +02:00
|
|
|
|
|
|
|
def mention(comment, user)
|
2013-02-14 01:50:51 +01:00
|
|
|
@comment = comment
|
2012-09-10 19:40:33 +02:00
|
|
|
@user = user
|
|
|
|
|
2013-06-30 08:29:51 +02:00
|
|
|
mail(
|
|
|
|
:to => user.email,
|
|
|
|
:subject => "[#{Rails.application.name}] Mention from " <<
|
|
|
|
"#{comment.user.username} on #{comment.story.title}"
|
|
|
|
)
|
2012-09-10 19:40:33 +02:00
|
|
|
end
|
2012-07-03 18:59:50 +02:00
|
|
|
end
|