0.46
No commit activity in last 3 years
No release in over 3 years
Devise Async provides an easy way to configure Devise to send its emails asynchronously using ActiveJob.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.6
~> 1.3

Runtime

>= 5.0
>= 4.0
 Project Readme

Devise Async

Tag Build Status Code Climate

Devise Async provides an easy way to configure Devise to send its emails asynchronously using ActiveJob.

Installation

Add this line to your application's Gemfile:

gem 'devise-async'

And then execute:

$ bundle

Or install it yourself as:

$ gem install devise-async

Usage

  1. Setup ActiveJob,
  2. Add :async to the devise call in your model:
class User < ActiveRecord::Base
  devise :database_authenticatable, :async, :confirmable # etc ...
end

Options

Enabling via config

The gem can be enabled/disabled easily via config, for example based on environment.

# config/initializers/devise_async.rb
Devise::Async.enabled = true # | false

Setup via block

To 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
end

Custom mailer class

Customize Devise.mailer at will and devise-async will honor it.

Older versions of Rails and devise

If you want to use this gem with Rails < 5 and/or devise < 4 check out older releases, please.

Testing

RSpec is used for testing. The following should be enough for running the test:

$ bundle exec rspec

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Released under the MIT License. See the LICENSE file for further details.