Skip to content

Instantly share code, notes, and snippets.

@madsheep
Created September 10, 2013 14:58
Show Gist options
  • 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