Skip to content

Instantly share code, notes, and snippets.

@temochka
Created August 2, 2011 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save temochka/1119688 to your computer and use it in GitHub Desktop.
Save temochka/1119688 to your computer and use it in GitHub Desktop.
post '/contact' do
subject = params[:title]
body = erb :email, :layout => false
begin
transport = Mailer::PostmarkTransport.new(POSTMARK_API_KEY)
transport.send_message(SENDER, RECIPIENT, subject, body) do |message|
message.tag = "contact-form"
end
rescue ArgumentError
redirect '/contact'
end
redirect '/contact_successful'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment