From 29e7e7019b0df925ceda65862391367af33594c9 Mon Sep 17 00:00:00 2001 From: Kristijan Sedlak Date: Thu, 19 Apr 2012 23:25:04 +0200 Subject: [PATCH] Adding the delayed_job integration instructions. --- README.rdoc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.rdoc b/README.rdoc index 0b8856b7..fd420486 100644 --- a/README.rdoc +++ b/README.rdoc @@ -118,6 +118,26 @@ add them to the initializer file. Inside the initializer, the comments will tell you what each setting does. +== DelayedJob Integration + +By default emails are sent synchronously. You can send them asynchronously by using the +[delayed_job gem](https://github.com/collectiveidea/delayed_job). + +After implementing the `delayed_job` 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 + mail = config.send(mailer).delay.send(config.send(method), self) + end + end + end + end + + == Full Features List by module: