Class: Chatterbox::Services::Email::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/chatterbox/services/email/mailer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.reloadable?Boolean

Returns:

  • (Boolean)


8
# File 'lib/chatterbox/services/email/mailer.rb', line 8

def self.reloadable?() false end

Instance Method Details

#message(data = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/chatterbox/services/email/mailer.rb', line 10

def message(data={})
  data = data.dup.symbolize_keys
    
  content_type data[:config][:content_type] || "text/plain" 

  recipients data[:config][:to]
  from       data[:config][:from]

  reply_to   data[:config][:reply_to] if data[:config][:reply_to]
  bcc        data[:config][:bcc] if data[:config][:bcc]
  cc         data[:config][:cc] if data[:config][:cc]

  subject    [data[:config][:summary_prefix], data[:summary]].join
  body       data[:body] if data[:body]
end