Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'sinatra'
- require 'flowdock'
- get '/feedback' do
- # render feedback form
- erb :feedback
- end
- post '/feedback' do
- # create a new Flow object with API Token and sender information
- flow = Flowdock::Flow.new(
- :api_token => "<YOUR_API_TOKEN_HERE>",
- :source => "feedback",
- :from => {
- :name => "Website Feedback",
- :address => "[email protected]"
- }
- )
- # send message to the flow
- flow.send_message(:subject => params[:subject],
- :content => params[:content],
- :tags => ["feedback"])
- redirect_to '/thanks'
- end
- get '/thanks'
- 'Thanks for the feedback!'
- end
Advertisement
Add Comment
Please, Sign In to add comment