Module: Postmark::SharedMessageExtensions

Included in:
Mail::Message, TMail::Mail
Defined in:
lib/postmark/message_extensions/shared.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) postmark_attachments



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/postmark/message_extensions/shared.rb', line 16

def postmark_attachments
  return if @_attachments.nil?
      
  @_attachments.collect do |item|
    if item.is_a?(Hash)
      item
    elsif item.is_a?(File)
      {
        "Name"        => item.path.split("/")[-1],
        "Content"     => [ IO.read(item.path) ].pack("m"),
        "ContentType" => "application/octet-stream"
      }
    end
  end
end

- (Object) postmark_attachments=(value)



12
13
14
# File 'lib/postmark/message_extensions/shared.rb', line 12

def postmark_attachments=(value)
  @_attachments = value.is_a?(Array) ? value : [value]
end

- (Object) tag



4
5
6
# File 'lib/postmark/message_extensions/shared.rb', line 4

def tag
  self['TAG']
end

- (Object) tag=(value)



8
9
10
# File 'lib/postmark/message_extensions/shared.rb', line 8

def tag=(value)
  self['TAG'] = value
end