title: Devise async not working with sidekiq (sending emails with Devise Mailer)
body: <p>I'm attempting to send multiple emails at once using Devise::Mailer. Using Devise Async, I would like to queue these emails rather than slow down the entire system by sending them altogether (which can delay the app by about 20 seconds). The main issue seems to be that the devise_async gem does not seem to be communicating with sidekiq at all (I don't see anything in the sidekiq logs).</p>
  
  <p>After much digging, the main difference from what I have and what is in the devise_async wiki, is that the devise_async.rb file was missing parameters (unfortunately, this still does not solve the problem). </p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>The problem might possibly be that I don't have a sidekiq worker--though the devise_async documentation doesn't talk about this. Do I need to trigger the sidekiq worker which would then trigger the UserMailer? I was under the impression that the UserMailer was itself a worker.</p>
  
  <p><strong>devise_async.rb</strong></p>
  
  <pre><code>Devise::Async.setup do |config|
    config.enabled = true
    config.backend = :sidekiq
    config.queue   = :default
  end
  </code></pre>
  
  <p><strong>sidekiq.yml</strong></p>
  
  <pre><code>:verbose: true
  :concurrency: 25
  production:
    :concurrency: 20
  :queues:
    - [mailer, 5]
    - [default, 5]
  </code></pre>
  
  <p><strong>devise.rb</strong></p>
  
  <pre><code>config.mailer_sender = 'test@gmail.com'
  config.mailer = 'UserMailer'
  </code></pre>
  
  <p><strong>user.rb</strong></p>
  
  <pre><code>after_create :send_email_notification
  
  devise :database_authenticatable, :registerable, :timeoutable,
           :recoverable, :rememberable, :trackable, :validatable, :async
  
  def send_email_notification
          user = User.find(id)
          team = Team.find(user.team_id)
  
          team.memberships.each do |membership|         
              UserMailer.notification_email(user, team, membership).deliver_later
          end
      end
  </code></pre>
  
  <p><strong>user_mailer.rb</strong></p>
  
  <pre><code>class UserMailer &lt; Devise::Mailer
      default from: "test@gmail.com"
  
      def notification_email(current_user, team, membership)
          @user = current_user
          if ENV["ENABLE_EMAIL"] == "YES"         
              if membership.user_id != current_user.id
                  subject = 'TEST'
                  @recipient_name = membership.user.userName.titleize
                  mail(to: membership.user.email, subject: subject)
              end     
          end
  
      end
  end
  </code></pre>