Class: Noticed::DeliveryMethods::Email

Inherits:
Base
  • Object
show all
Defined in:
lib/noticed/delivery_methods/email.rb

Instance Attribute Summary

Attributes inherited from Base

#notification, #options, #params, #recipient, #record

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#perform

Class Method Details

.validate!(options) ⇒ Object



8
9
10
11
12
# File 'lib/noticed/delivery_methods/email.rb', line 8

def self.validate!(options)
  unless options.key?(:mailer)
    raise ValidationError, "email delivery method requires a 'mailer' to be specified"
  end
end

Instance Method Details

#deliverObject



4
5
6
# File 'lib/noticed/delivery_methods/email.rb', line 4

def deliver
  mailer.with(format).send(method.to_sym).deliver_later
end