Created
March 25, 2011 01:04
-
-
Save jpablobr/886198 to your computer and use it in GitHub Desktop.
Displays Sendgrid statistics for Heroku apps
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
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=<[email protected]>" | |
else | |
resource = RestClient::Resource.new("https://test-mail.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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment