Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

made a few changes, moved pony options to mail.rb

  • Loading branch information...
commit d4ea8b2f90a67c77bc526beb81b702aac6800406 1 parent 45f3406
@moollaza authored
Showing with 22 additions and 22 deletions.
  1. +6 −6 Gemfile.lock
  2. +4 −16 app.rb
  3. +12 −0 config/initializers/mail.rb
View
12 Gemfile.lock
@@ -2,11 +2,11 @@ GEM
remote: http://rubygems.org/
specs:
chunky_png (1.2.5)
- compass (0.11.6)
+ compass (0.11.7)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
- fssm (0.2.7)
+ fssm (0.2.8.1)
grid-coordinates (1.1.9)
compass (>= 0.11.5)
haml (3.1.4)
@@ -19,12 +19,12 @@ GEM
polyglot (0.3.3)
pony (1.4)
mail (> 2.0)
- rack (1.4.0)
- rake (0.9.2)
- sass (3.1.12)
+ rack (1.4.1)
+ rake (0.9.2.2)
+ sass (3.1.15)
shotgun (0.9)
rack (>= 1.0)
- sinatra (1.2.7)
+ sinatra (1.2.8)
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
tilt (1.3.3)
View
20 app.rb
@@ -1,6 +1,7 @@
require 'rubygems'
require 'sinatra'
require 'haml'
+require 'pony'
require './lib/partials'
# Set Sinatra variables
@@ -32,27 +33,14 @@
haml :contact, :layout => :'layouts/page'
end
+# Handle Emails
post '/contact' do
- require 'pony'
-
@emailSent = true
- Pony.options = {
- :via => :smtp,
- :via_options => {
- :address => 'smtp.sendgrid.net',
- :port => '587',
- :domain => 'heroku.com',
- :authentication => :plain,
- :user_name => ENV['SENDGRID_USERNAME'],
- :password => ENV['SENDGRID_PASSWORD'],
- :enable_starttls_auto => true
- }
- }
Pony.mail({
:to => 'moollaza@gmail.com',
- :from => params[:email],
- :subject => params[:name] + ' - ' + params[:subject],
+ :from => params[:name] + '<' + params[:email] + '>',
+ :subject => params[:subject],
:body => params[:body]
})
View
12 config/initializers/mail.rb
@@ -0,0 +1,12 @@
+Pony.options = {
+ :via => :smtp,
+ :via_options => {
+ :address => 'smtp.sendgrid.net',
+ :port => '587',
+ :domain => 'heroku.com',
+ :user_name => ENV['SENDGRID_USERNAME'],
+ :password => ENV['SENDGRID_PASSWORD'],
+ :authentication => :plain,
+ :enable_starttls_auto => true
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.