Module: Lazylead::Emailing

Included in:
Exchange, Postman
Defined in:
lib/lazylead/email.rb

Overview

Email notifications utilities.

Instance Method Summary collapse

Instance Method Details

#make_body(opts) ⇒ Object

Construct html document from template and binds.



31
32
33
34
35
36
# File 'lib/lazylead/email.rb', line 31

def make_body(opts)
  Email.new(
    opts["template"],
    opts.merge(version: Lazylead::VERSION)
  ).render
end

#split(type, opts) ⇒ Object

Split text with email addresses by ‘,’ and trim all elements if needed.



39
40
41
42
43
44
45
# File 'lib/lazylead/email.rb', line 39

def split(type, opts)
  if opts[type].include? ","
    opts[type].split(",").map(&:strip).reject(&:empty?)
  else
    [opts[type]]
  end
end