Guest User

Untitled

a guest
Sep 17th, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Undefined method `haml' when rendering haml in Pony mail from scheduled job
  2. require 'sinatra'
  3. require 'haml'
  4. require 'pony'
  5.  
  6. get "/execute_all/?" do
  7. execute_all_tests()
  8. Pony.mail :to => "recipients@email.com",
  9. :from => "do-not-reply@email.com",
  10. :subject => "Test results,
  11. :html_body => haml(:email_layout)
  12.  
  13. redirect "/"
  14.  
  15. end
  16.  
  17. scheduler caught exception:
  18. undefined method `haml' for main:Object
  19.  
  20. scheduler = Rufus::Scheduler.start_new
  21. scheduler.every '2h' do
  22. execute_all_tests()
  23. Pony.mail :to => "recipients@email.com",
  24. :from => "do-not-reply@email.com",
  25. :subject => "Test results,
  26. :html_body => haml(:email_layout)
  27. end
Add Comment
Please, Sign In to add comment