Class: Authify::Core::Jobs::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/authify/core/jobs/email.rb

Overview

A Resque job for sending email (using Pony)

Class Method Summary collapse

Class Method Details

.perform(to:, subject:, body: nil, html_body: nil, headers: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/authify/core/jobs/email.rb', line 7

def self.perform(to:, subject:, body: nil, html_body: nil, headers: nil)
  config = {
    to: to,
    from: CONFIG[:mail][:from],
    subject: subject,
    via_options: CONFIG[:mail][:server]
  }

  config[:headers]   = headers if headers
  config[:body]      = body if body
  config[:html_body] = html_body if html_body

  Pony.mail config
end