wblog/app/mailers/post_mailer.rb

11 lines
241 B
Ruby
Raw Permalink Normal View History

class PostMailer < ActionMailer::Base
domain = ENV['DOMAIN_NAME'] || 'example.com'
default from: "no-reply@#{domain}"
2016-04-27 12:22:37 +08:00
def born(post_id, to)
@post = Post.find(post_id)
mail to: to, subject: '客官, 新博客来了'
end
end