postmark-rails 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -24,15 +24,27 @@ Then
24
24
  # ...
25
25
  end
26
26
 
27
- The, make postmark the delivery method for the production environment:
27
+ Next, make postmark the delivery method for the production environment:
28
28
 
29
29
  config/environments/production.rb
30
30
 
31
31
  config.action_mailer.delivery_method = :postmark
32
32
 
33
+ You may also tag messages, in order to track bounces more precisely.
34
+
35
+ class TestMailer < ActionMailer::Base
36
+ def tagged_message
37
+ subject 'hello'
38
+ recipients 'sheldon@bigbangtheory.com'
39
+ from 'leonard@bigbangtheory.com'
40
+ tag 'delivery'
41
+ end
42
+ end
43
+
33
44
  == Limitations
34
45
 
35
- Currently postmark API does not support multiple recipients, or attachments. For more information, check the docs at http://developer.postmarkapp.com.
46
+ Currently postmark API does not support attachments. For more information, check the docs here:
47
+ http://developer.postmarkapp.com
36
48
 
37
49
  == Requirements
38
50
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.2.0
@@ -5,12 +5,32 @@ module PostmarkMethods
5
5
  def perform_delivery_postmark(message)
6
6
  Postmark.send_through_postmark(message)
7
7
  end
8
+
9
+ def tag(value)
10
+ @tag = value
11
+ end
12
+
13
+ def self.included(base)
14
+ base.extend(ClassMethods)
15
+ base.class_eval do
16
+ alias_method_chain :create_mail, :tag
17
+ end
18
+ end
19
+
20
+ def create_mail_with_tag
21
+ returning create_mail_without_tag do |mail|
22
+ mail.tag = @tag if @tag
23
+ end
24
+ end
25
+
26
+ module ClassMethods
27
+ def postmark_api_key=(value)
28
+ Postmark.api_key = value
29
+ end
30
+ end
31
+
8
32
  end
9
33
 
10
34
  class ActionMailer::Base
11
35
  include PostmarkMethods
12
-
13
- def self.postmark_api_key=(value)
14
- Postmark.api_key = value
15
- end
16
36
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{postmark-rails}
8
- s.version = "0.1.3"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Petyo Ivanov"]
12
- s.date = %q{2010-01-25}
12
+ s.date = %q{2010-03-23}
13
13
  s.description = %q{Use this plugin in your rails applications to send emails through the Postmark API}
14
14
  s.email = %q{underlog@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "spec/fixtures/views/test_mailer/multipart_message.text.html.erb",
30
30
  "spec/fixtures/views/test_mailer/multipart_message.text.plain.erb",
31
31
  "spec/fixtures/views/test_mailer/simple_message.erb",
32
+ "spec/fixtures/views/test_mailer/tagged_message.erb",
32
33
  "spec/postmark-rails_spec.rb",
33
34
  "spec/spec.opts",
34
35
  "spec/spec_helper.rb"
@@ -42,7 +43,7 @@ Gem::Specification.new do |s|
42
43
  }
43
44
  s.rdoc_options = ["--charset=UTF-8"]
44
45
  s.require_paths = ["lib"]
45
- s.rubygems_version = %q{1.3.5}
46
+ s.rubygems_version = %q{1.3.6}
46
47
  s.summary = %q{Postmark adapter for ActionMailer}
47
48
  s.test_files = [
48
49
  "spec/fixtures/models/test_mailer.rb",
@@ -12,4 +12,11 @@ class TestMailer < ActionMailer::Base
12
12
  from 'leonard@bigbangtheory.com'
13
13
  end
14
14
 
15
+ def tagged_message
16
+ subject 'hello'
17
+ recipients 'sheldon@bigbangtheory.com'
18
+ from 'leonard@bigbangtheory.com'
19
+ tag 'delivery'
20
+ end
21
+
15
22
  end
@@ -1,6 +1,7 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe "PostmarkRails" do
4
+
4
5
  it "should use postmark for delivery" do
5
6
  Postmark.should_receive(:send_through_postmark) do |message|
6
7
  message.subject.should == "hello"
@@ -8,4 +9,11 @@ describe "PostmarkRails" do
8
9
  TestMailer.deliver_simple_message
9
10
  end
10
11
 
12
+ it "should allow tagging of message" do
13
+ Postmark.should_receive(:send_through_postmark) do |message|
14
+ message.tag.to_s.should == "delivery"
15
+ end
16
+ TestMailer.deliver_tagged_message
17
+ end
18
+
11
19
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmark-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Petyo Ivanov
@@ -9,29 +14,33 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-01-25 00:00:00 +02:00
17
+ date: 2010-03-23 00:00:00 +02:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :development
31
+ version_requirements: *id001
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: postmark
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
33
41
  version: "0"
34
- version:
42
+ type: :runtime
43
+ version_requirements: *id002
35
44
  description: Use this plugin in your rails applications to send emails through the Postmark API
36
45
  email: underlog@gmail.com
37
46
  executables: []
@@ -54,6 +63,7 @@ files:
54
63
  - spec/fixtures/views/test_mailer/multipart_message.text.html.erb
55
64
  - spec/fixtures/views/test_mailer/multipart_message.text.plain.erb
56
65
  - spec/fixtures/views/test_mailer/simple_message.erb
66
+ - spec/fixtures/views/test_mailer/tagged_message.erb
57
67
  - spec/postmark-rails_spec.rb
58
68
  - spec/spec.opts
59
69
  - spec/spec_helper.rb
@@ -70,18 +80,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
80
  requirements:
71
81
  - - ">="
72
82
  - !ruby/object:Gem::Version
83
+ segments:
84
+ - 0
73
85
  version: "0"
74
- version:
75
86
  required_rubygems_version: !ruby/object:Gem::Requirement
76
87
  requirements:
77
88
  - - ">="
78
89
  - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
79
92
  version: "0"
80
- version:
81
93
  requirements: []
82
94
 
83
95
  rubyforge_project:
84
- rubygems_version: 1.3.5
96
+ rubygems_version: 1.3.6
85
97
  signing_key:
86
98
  specification_version: 3
87
99
  summary: Postmark adapter for ActionMailer