Skip to content

Commit

Permalink
Basic routes established
Browse files Browse the repository at this point in the history
  • Loading branch information
Besermenji committed Jun 30, 2016
1 parent 0d0f44d commit 960814a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions report_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ class ReportGenerator < Sinatra::Base
status 200
end

post '/ios/?' do
@ios_info = JSON.parse(params["data"])
# generate_pdf('reports/kuf-report-template.html')
# Pony.mail(:to => @kuf_info["email"],
# :from => '[email protected]',
# :subject => 'hi',
# :body => "Hello there. It is #{DateTime.now}. Enjoy your KUF report.",
# :attachments => {"KUF_report_#{DateTime.now}.pdf" => File.read(@file)})
status 200
end

post '/partner_card/?' do
@partner_card = JSON.parse(params["data"])
# generate_pdf('reports/kuf-report-template.html')
# Pony.mail(:to => @kuf_info["email"],
# :from => '[email protected]',
# :subject => 'hi',
# :body => "Hello there. It is #{DateTime.now}. Enjoy your KUF report.",
# :attachments => {"KUF_report_#{DateTime.now}.pdf" => File.read(@file)})
status 200
end

def generate_pdf(pdf_path)
kit = PDFKit.new(erb pdf_path.to_sym)
kit.stylesheets << 'views/reports/css/bootstrap-theme.min.css'
Expand Down

0 comments on commit 960814a

Please sign in to comment.