Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@madsheep
Created September 10, 2013 14:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madsheep/6510676 to your computer and use it in GitHub Desktop.
Save madsheep/6510676 to your computer and use it in GitHub Desktop.
Any mailer inherited from this one will have random cat included as an attachment.
class KittenMailer < ActionMailer::Base
def mail *args
attachments['cat.jpeg'] = open("http://placekitten.com/#{rand(300)+300}/#{rand(300)+300}").read
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment