2012-11-13 20:28:15 +00:00
|
|
|
class PostMailer < ApplicationMailer
|
|
|
|
default from: "from@example.com"
|
|
|
|
layout "application"
|
|
|
|
|
2013-01-16 16:30:53 +00:00
|
|
|
# Mailers don't import app/helpers automatically
|
|
|
|
helper :application
|
|
|
|
|
2012-11-13 20:28:15 +00:00
|
|
|
def decorated_email(post)
|
|
|
|
@post = post.decorate
|
|
|
|
mail to: "to@example.com", subject: "A decorated post"
|
|
|
|
end
|
2013-01-16 16:30:53 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def goodnight_moon
|
|
|
|
"Goodnight, moon!"
|
|
|
|
end
|
|
|
|
helper_method :goodnight_moon
|
2012-11-13 20:28:15 +00:00
|
|
|
end
|