Search code examples
ruby-on-railsredisactionmailersidekiq

Sidekiq -- Email.delay.sendMail


So, I have this code

class InvoiceNotifier < ActionMailer::Base
  include Sidekiq::Worker
  default from: '[email protected]',
          return_path: '[email protected]'


  def testEmail(recipient)
    @account = recipient

    mail(to: recipient).deliver
  end

end

running the command (from console)

InvoiceNotifier.sendMail('[email protected]')

works, though

InvoiceNotifier.delay.sendMail('[email protected]')

does not work, and it returns a string.

How do I debug this? I look at redis and it has 3 keys, though none of them appear to have any values.

Help?


Solution

  • The perform method is not required. The problem was I wasn't doing

    bundle exec sidekiq
    

    from command line to actually have an interface to interact with.. http://railscasts.com/episodes/366-sidekiq?view=asciicast is a great place to go to learn since I wasn't really looking at the front page of sidekiq to do their 'get started guide' and while it's on the front page to execute this command, I didn't notice it when I was diving in.