We\'ve been mocking up our email jobs with success until we actually included our SendGrid Gem at the top of our worker
require \'sendgrid-ruby\'
include SendGri
include SendGrid it the culprit.
It adds all constants from the SendGrid module to the current module (which is probably the top level), so you can use SendGrid's classes without prefix, e.g. just Email.new instead of SendGrid::Email.new.
The downside is that it also messes with your existing constants.
You can either include it under a specific module:
class Notifications::WelcomeWorker
include Sidekiq::Worker
include SendGrid
# ...
end
Then, Email resolves to Sendgrid::Email and ::Email resolves to your top-level Email class.
Or you could simply remove the include SendGrid line and use the SendGrid:: prefix.