Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 3928e729a61db4b613a748a9d1617b9b9c23691b 0 parents
@hone authored
Showing with 21 additions and 0 deletions.
  1. +21 −0 init.rb
21 init.rb
@@ -0,0 +1,21 @@
+class Heroku::Command::Sendgrid < Heroku::Command::Base
+ def test_email
+ app = extract_app
+ vars = heroku.config_vars(app)
+ to = ''
+ args.each do |arg|
+ key, value = arg.split("=")
+ to = value if key == "to"
+ end
+
+ if to.empty?
+ error "please specify an address to send to using to=<me@example.com>"
+ else
+ resource = RestClient::Resource.new("https://pony-mail-test.heroku.com")
+ display resource["/mail"].post(:sendgrid_username => vars["SENDGRID_USERNAME"],
+ :sendgrid_password => vars["SENDGRID_PASSWORD"],
+ :sendgrid_domain => vars["SENDGRID_DOMAIN"],
+ :to => to)
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.