Sha256: 9786fbd1c4bc58aa38b4b05a5e83c1957f416d08015b0af9564a886b32ee8796

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

module Devmail
  class DevelopmentMailInterceptor
    def self.delivering_email(message)
      dm = DevMail.new

      dm.from = message.from
      dm.to = message.to
      dm.cc = message.cc
      dm.bcc = message.bcc
      dm.sender = message.sender
      dm.subject = message.subject
      dm.reply_to = message.reply_to

      dm.multipart = message.multipart?

      if message.multipart?
        dm.text_part = message.text_part.decoded
        dm.html_part = message.html_part.decoded
      else
        dm.text_part = message.decoded
      end

      dm.mail = message

      dm.save

      message
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devmail-0.0.1 lib/devmail/development_mail_interceptor.rb