Class: Office::EmailMessage

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/office/email_message.rb

Overview

When I receive one.

Instance Method Summary collapse

Instance Method Details

#convObject



50
51
52
# File 'lib/office/email_message.rb', line 50

def conv
  email_conversation
end

#leadObject



31
32
33
# File 'lib/office/email_message.rb', line 31

def lead
  Lead.find_by email: from
end

#object_keyObject

aka ‘filename’, use with bucket name + prefix. I need this!



19
# File 'lib/office/email_message.rb', line 19

field :object_key,  type: :string

#preview_strObject



54
55
56
57
58
59
# File 'lib/office/email_message.rb', line 54

def preview_str
  body = part_html || part_html || 'Neither part_html nor part_txt!'
  body = ::ActionView::Base.full_sanitizer.sanitize( body ).gsub(/\s+/, ' ')
  body = body[0..200]
  body
end

#received_atObject



45
46
47
# File 'lib/office/email_message.rb', line 45

def received_at
  date
end