-
Notifications
You must be signed in to change notification settings - Fork 229
DelayedJob and ActiveJob Integration
Wout edited this page Oct 20, 2020
·
1 revision
By default emails are sent synchronously. You can send them asynchronously by using the delayed_job gem or Rails' ActiveJob.
After implementing the delayed_job
or ActiveJob
into your project add the
code below at the end of the config/initializers/sorcery.rb
file. After that
all emails will be sent asynchronously.
module Sorcery
module Model
module InstanceMethods
def generic_send_email(method, mailer)
config = sorcery_config
# DelayedJob
mail = config.send(mailer).delay.send(config.send(method), self)
# ActiveJob
mail = config.send(mailer).send(config.send(method), self).deliver_later
end
end
end
end
Meta
Using Sorcery
- Activity Logging
- Brute Force Protection
- DataMapper Support
- DelayedJob Integration
- Distinguish login failure reasons
- External
- External---Microsoft-Graph-authentication
- Fetching Currently Active Users
- HTTP Basic Auth
- Integration Testing
- OAuth Landing Page
- Password-less Activation
- Remember Me
- Reset Password
- Routes Constraints
- Session Timeout
- Simple Password Authentication
- Single Table Inheritance Support
- Testing Rails
- User Activation
Contributing to Sorcery