在后台发送 Devise 的邮件。支持 Resque、Sidekiq、Delayed::Job 和 QueueClassic。
在后台发送 Devise 的邮件。支持 Resque、Sidekiq、Delayed::Job 和 QueueClassic。
Devise Async provides an easy way to configure Devise to send its emails asynchronously using ActiveJob.
Add this line to your application's Gemfile:
gem 'devise-async'And then execute:
$ bundleOr install it yourself as:
$ gem install devise-async:async to the devise call in your model:class User < ActiveRecord::Base
devise :database_authenticatable, :async, :confirmable # etc ...
endThe gem can be enabled/disabled easily via config, for example based on environment.
# config/initializers/devise_async.rb
Devise::Async.enabled = true # | falseTo avoid repeating Devise::Async in the initializer file you can use the block syntax
similar to what Devise offers.
# config/initializers/devise_async.rb
Devise::Async.setup do |config|
config.enabled = true
endCustomize Devise.mailer at will and devise-async will honor it.
If you want to use this gem with Rails < 5 and/or devise < 4 check out older releases, please.
RSpec is used for testing. The following should be enough for running the test:
$ bundle exec rspecgit checkout -b my-new-feature)git commit -am 'Added some feature')git push origin my-new-feature)Released under the MIT License. See the LICENSE file for further details.
暂无开放 Issues,或尚未同步最近议题。