Class: MailStats::InterceptorPrototype

Inherits:
Object
  • Object
show all
Defined in:
lib/mail_stats/interceptors/interceptor_prototype.rb

Direct Known Subclasses

MailStatsInterceptor

Constant Summary collapse

VALID_URL_REGEX =
/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix

Class Method Summary collapse

Class Method Details

.delivering_email(message) ⇒ Object



7
8
9
10
11
# File 'lib/mail_stats/interceptors/interceptor_prototype.rb', line 7

def self.delivering_email(message)
  message.body.parts.each do |part| 
    part.body = self.process(part, message.to, message.subject) if part.content_type =~ /text\/html/ 
  end
end

.process(part) ⇒ Object



13
14
15
# File 'lib/mail_stats/interceptors/interceptor_prototype.rb', line 13

def self.process(part)
  part.body.to_s
end