Created
June 5, 2013 19:53
-
-
Save luke-gru/5716783 to your computer and use it in GitHub Desktop.
test what email looks like in Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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