Module: AbAdmin::Mailers::MailAttachHelper::InstanceMethods

Defined in:
lib/ab_admin/mailers/mail_attach_helper.rb

Instance Method Summary collapse

Instance Method Details

#image_to_attach(text) ⇒ Object


40
41
42
# File 'lib/ab_admin/mailers/mail_attach_helper.rb', line 40

def image_to_attach(text)
  prepare_attachments(text).replace_attaches(attachments)
end

#prepare_attachments(text) ⇒ Object


44
45
46
47
48
49
50
# File 'lib/ab_admin/mailers/mail_attach_helper.rb', line 44

def prepare_attachments(text)
  parsed = MailAttacher.new(text)
  parsed.images.each do |image|
    attachments.inline[image[2]] = File.read(image[1])
  end
  parsed
end