Created
November 20, 2009 15:43
-
-
Save graysky/239569 to your computer and use it in GitHub Desktop.
This file contains 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
# Open an email in Mail.app to preview an HTML email. | |
# | |
# Usage: preview_email( MyMailer.create_welcome_msg ) | |
# | |
def preview_email(tmail) | |
f = File.open("#{Dir::tmpdir}/email_preview_#{rand(10000)}.eml", 'w') | |
f.write(tmail.to_s) | |
f.flush | |
f.close | |
`open #{f.path}` | |
f | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment