public
Created

DAZ4126 Contact form code

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
post '/' do
require 'pony'
Pony.mail(
from: "DAZ4126<daz4126@gmail.com>",
to: 'daz4126@gmail.com',
subject: "A message from the DAZ4126 website",
body: params[:message],
port: '587',
via: :smtp,
via_options: {
:address => 'smtp.sendgrid.net',
:port => '587',
:enable_starttls_auto => true,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:authentication => :plain,
:domain => 'heroku.com'
})
redirect '/success'
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.