2014-05-25 00:54:52 +08:00
|
|
|
class CommentMailer < ActionMailer::Base
|
|
|
|
domain = ENV['DOMAIN_NAME'] || 'example.com'
|
|
|
|
|
|
|
|
default from: "no-reply@#{domain}"
|
|
|
|
|
2016-04-27 12:22:37 +08:00
|
|
|
def born(comment_id, to)
|
2014-05-25 00:54:52 +08:00
|
|
|
@comment = Comment.find(comment_id)
|
|
|
|
mail to: to, subject: '博主, 你的博客有新的评论'
|
|
|
|
end
|
|
|
|
|
|
|
|
def reply(comment_id, to)
|
|
|
|
@comment = Comment.find(comment_id)
|
|
|
|
mail to: to, subject: '客官, 你评论过的博客有新的回复'
|
|
|
|
end
|
|
|
|
end
|