wblog/app/mailers/comment_mailer.rb

16 lines
416 B
Ruby
Raw Permalink Normal View History

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)
@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