Permalink
Browse files

Flailing wildly to try to stay above water. Sinking.

  • Loading branch information...
1 parent 487adf9 commit f56f4a4c64445a1cb12c985779cdd51f00e6fc29 @chadoh committed May 4, 2010
Showing with 15 additions and 13 deletions.
  1. +15 −13 controls.rb
View
@@ -101,22 +101,24 @@ def method_missing(name)
end
post "/contact" do
- Pony.mail do
- :to => 'chad.ostrowski@gmail.com',
+ smtp_options = { :address => 'smtp.sendgrid.net',
+ :port => '25',
+ :authentication => :plain,
+ :user_name => ENV['SENDGRID_USERNAME'],
+ :password => ENV['SENDGRID_PASSWORD'],
+ :domain => ENV['SENDGRID_DOMAIN']
+ }
+ mail_options = { :to => 'chad.ostrowski@gmail.com',
:from => 'chad@lisli.net',
- :subject => 'Mail from Lisli.net!',
:body => 'Woooo!',
+ :subject => "Mail from Lisli.net!",
:via => :smtp,
- :via_options => {
- :address => 'smtp.sendgrid.net',
- :port => '25',
- :authentication => :plain,
- :user_name => ENV['SENDGRID_USERNAME'],
- :password => ENV['SENDGRID_PASSWORD'],
- :domain => ENV['SENDGRID_DOMAIN']
- }
- end
-
+ :via_options => smtp_options
+ }
+ puts mail_options.keys
+ puts smtp_options.keys
+ Pony.mail mail_options
+
flash.now[:notice] = "Thanks for your message! I'll get back to you soon."
haml :contact
end

0 comments on commit f56f4a4

Please sign in to comment.