Sha256: dd28c514a6e326b44b884d1c8be874956fab73da150939dbd83290c17b47c3c6

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

module Postmark
  module SharedMessageExtensions

    def self.included(klass)
      klass.instance_eval do
        attr_accessor :delivered, :postmark_response
      end
    end

    def delivered?
      self.delivered
    end

    def tag(val = nil)
      default 'TAG', val
    end

    def tag=(val)
      header['TAG'] = val
    end

    def postmark_attachments=(value)
      Kernel.warn("Mail::Message#postmark_attachments= is deprecated and will " \
                  "be removed in the future. Please consider using the native " \
                  "attachments API provided by Mail library.")
      @_attachments = value
    end

    def postmark_attachments
      return [] if @_attachments.nil?
      Kernel.warn("Mail::Message#postmark_attachments is deprecated and will " \
                  "be removed in the future. Please consider using the native " \
                  "attachments API provided by Mail library.")

      Postmark::MessageHelper.attachments_to_postmark(@_attachments)
    end

    protected

    def pack_attachment_data(data)
      MessageHelper.encode_in_base64(data)
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
postmark-1.2.1 lib/postmark/message_extensions/shared.rb
postmark-1.2.0 lib/postmark/message_extensions/shared.rb
postmark-1.1.2 lib/postmark/message_extensions/shared.rb
postmark-1.1.1 lib/postmark/message_extensions/shared.rb
postmark-1.1.0 lib/postmark/message_extensions/shared.rb
postmark-1.0.2 lib/postmark/message_extensions/shared.rb
postmark-1.0.1 lib/postmark/message_extensions/shared.rb
postmark-1.0.0 lib/postmark/message_extensions/shared.rb