Module: PostmarkDeliveryMethod

Defined in:
lib/postmark_delivery_method.rb

Overview

This module is only used for Rails 2.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/postmark_delivery_method.rb', line 14

def self.included(base)
  base.extend(ClassMethods)
  
  base.class_eval do      
    alias_method_chain :create_mail, :postmark_extras
  end
end

Instance Method Details

#create_mail_with_postmark_extrasObject



34
35
36
37
38
39
# File 'lib/postmark_delivery_method.rb', line 34

def create_mail_with_postmark_extras
  create_mail_without_postmark_extras.tap do |mail|
    mail.tag = @tag                          if @tag
    mail.postmark_attachments = @attachments if @attachments
  end
end

#perform_delivery_postmark(message) ⇒ Object



22
23
24
# File 'lib/postmark_delivery_method.rb', line 22

def perform_delivery_postmark(message)
  Postmark.send_through_postmark(message)
end

#postmark_attachments(value) ⇒ Object



30
31
32
# File 'lib/postmark_delivery_method.rb', line 30

def postmark_attachments(value)
  @attachments = value
end

#tag(value) ⇒ Object



26
27
28
# File 'lib/postmark_delivery_method.rb', line 26

def tag(value)
  @tag = value
end