Class: Sidekiq::Extensions::DelayedMailer

Inherits:
Object
  • Object
show all
Includes:
Worker
Defined in:
lib/sidekiq/extensions/action_mailer.rb

Overview

Adds a ‘delay’ method to ActionMailer to offload arbitrary email delivery to Sidekiq. Example:

UserMailer.delay.send_welcome_email(new_user)

Instance Method Summary collapse

Methods included from Worker

included, #logger

Instance Method Details

#perform(yml) ⇒ Object



13
14
15
16
# File 'lib/sidekiq/extensions/action_mailer.rb', line 13

def perform(yml)
  (target, method_name, args) = YAML.load(yml)
  target.send(method_name, *args).deliver
end