Skip to content

Instantly share code, notes, and snippets.

@luke-gru
Created June 5, 2013 19:53
Show Gist options
  • Save luke-gru/5716783 to your computer and use it in GitHub Desktop.
Save luke-gru/5716783 to your computer and use it in GitHub Desktop.
test what email looks like in Rails
class Order
def send_order_email
OrderMailer.send_email(self).deliver
end
def test_order_email
body = send_order_email.body.to_s
File.open(File.join(Rails.root, 'public', 'email_test.html'), 'w') do |f|
f.puts body
end
'public/email_test.html'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment