anandagrawal84 / resque_failed_job_mailer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview Build Status

The resque-failed-job-mailer gem is used to send email along with whole exception backtrace whenever there is any failure in resque job.

Installation

Installation of the plugin can be done using the built in Rails plugin script. Issue the following command from the root of your Rails application:

$ ./script/rails plugin install git://github.com/anandagrawal84/resque_failed_job_mailer.git

or add it to your Gemfile:

gem 'resque-failed-job-mailer', :require => 'resque_failed_job_mailer'

and run bundle install to install the new dependency.

Usage

All you need to do is configure ActionMailer for smtp details. Add following configuration file resque_failed_job_mailer.rb in config/initializer folder

Resque::Failure::Notifier.configure do |config|
  config.from = 'dummy@dummy.com' # from address
  config.to = 'dummy@dummy.com' # to address
  config.include_payload = true # enabled by default
end

as soon as resque job fail it would send out an email to the configured email address.

Configuration

If you want to use your own email mechanism then add following configuration

Resque::Failure::Notifier.configure do |config|
  config.mailer = ActionMailerClass
  config.mail = ActionMailerMailMethod
  config.from = 'dummy@dummy.com' # from address
  config.to = 'dummy@dummy.com' # to address
end

config.mailer is any class that extends ActionMailer::Base

config.mail is mail in class given above in config.mailer

About


Languages

Language:Ruby 100.0%