Skip to content

Commit

Permalink
Last chance at configuring sendgrid. #reviewthis @tonydewan
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydewan committed Jul 18, 2010
1 parent a8a83c7 commit 7ddcb39
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions reviewthis.rb
Expand Up @@ -20,27 +20,29 @@

configure :production do
# only run om Heroku
set :from, ENV['SENDGRID_USERNAME']
set :via, :smtp
set :via_settings, {
:address => "smtp.sendgrid.net",
:port => "25",
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => ENV['SENDGRID_DOMAIN']
:domain => ENV['SENDGRID_DOMAIN'],
}

end

configure :development, :test do
set :from, 'info@localhost'
set :via, :sendmail
set :via_settings, {}
end

helpers do
def mail(params)
body = mustache :email, {}, params
Pony.mail(:to => params[:email], :from => ENV['EMAIL_FROM'], :subject => "Code Review Request: from #{params[:commit_author]}", :body => body, :via => options.via, :via_settings => options.via_settings)
Pony.mail(:to => params[:email], :from => options.from, :subject => "Code Review Request: from #{params[:commit_author]}", :body => body, :via => options.via, :via_settings => options.via_settings)
end
end

Expand Down

0 comments on commit 7ddcb39

Please sign in to comment.