postmark-rails 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e19e74b205359301f7a9f43ccee0a6bedc5d627c
4
- data.tar.gz: 9ecbb60843f47b56a32433759fc6f102abde033a
3
+ metadata.gz: c62f6b45f10c52806e46eff8aa25d6f45b622b38
4
+ data.tar.gz: 749d24ff167f6b415a695379cafa1d012eeb385a
5
5
  SHA512:
6
- metadata.gz: 25d7ebfc39d73d1562fa5f419490697c7527a6ac04ea2aef4ecdbf8ba335a9ed16ef9acc9ec084aca6f7b5b0d0c65ffbef29165f5970657f0c674cbdf8f58232
7
- data.tar.gz: 7a042cfad8c1adef5852d2b040ffac1435f39e97f7f391584628b4540ca336b79a8f2f49478a8b5e81efdbc1500d4d0986d44dc8e0501f72218ae61db04faaef
6
+ metadata.gz: bcc5c1756734de3d28198c09d57dafdaa193532d728baec9a0a7f0772da25078e8aacd8ae3e6451aefa8b530aa8ca6a020db8a7d0bb101df7bc196e242b947a6
7
+ data.tar.gz: d57ce0c984f874a8b9571f340acdce2b768ea6a90f8d1ead325a258128de5d784d2f19bcb66dceb7673fe30ce7fe6f6593b21e437aba7e400fbf02a4894855f0
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
- - 1.9.2
5
4
  - 1.9.3
6
5
  - 2.0.0
6
+ - 2.1.0
7
7
  script: bundle exec rake spec
8
8
  gemfile:
9
9
  - Gemfile
@@ -15,8 +15,4 @@ matrix:
15
15
  - rvm: 1.8.7
16
16
  gemfile: Gemfile
17
17
  - rvm: 1.8.7
18
- gemfile: gemfiles/Gemfile.actionmailer-4.0.x
19
- - rvm: 1.9.2
20
- gemfile: Gemfile
21
- - rvm: 1.9.2
22
18
  gemfile: gemfiles/Gemfile.actionmailer-4.0.x
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = Changelog
2
2
 
3
+ == 0.8.0
4
+
5
+ * Added support for open tracking.
6
+ * Updated the postmark gem dependency to 1.3.x.
7
+
3
8
  == 0.7.0
4
9
 
5
10
  * Updated the postmark gem dependency to 1.2.x.
data/Gemfile CHANGED
@@ -3,5 +3,6 @@ source "http://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem 'rspec', '~> 2.13.0'
7
- end
6
+ gem 'rspec', '~> 2.14.0'
7
+ gem 'mime-types', '~> 1.25.1'
8
+ end
data/README.md CHANGED
@@ -16,7 +16,7 @@ For Rails 2.3 please take a look at [version 0.4](https://github.com/wildbit/pos
16
16
  Add this to your Gemfile: (change version numbers if needed)
17
17
 
18
18
  ``` ruby
19
- gem 'postmark-rails', '~> 0.7.0'
19
+ gem 'postmark-rails', '~> 0.8.0'
20
20
  ```
21
21
 
22
22
  Don’t forget to run `bundle install` command every time you change something in the Gemfile.
@@ -32,10 +32,12 @@ The `postmark_settings` hash can contain [all options](https://github.com/wildbi
32
32
 
33
33
  For the API details, refer to the [developer documentation](http://developer.postmarkapp.com).
34
34
 
35
- ## Tagging your deliveries
35
+ ## Tracking opens and tagging your deliveries
36
36
 
37
37
  You can use tags to categorize outgoing messages and attach application-specific information. Tagging the different types of email that you send lets you [review statistics and bounce reports separately](http://developer.postmarkapp.com/developer-build.html#message-format).
38
38
 
39
+ Pass `:track_opens => 'true'` to enable/disable open tracking on per-message basis. Check out the [Triggers API](https://github.com/wildbit/postmark-gem/wiki/The-Triggers-API-Support) to see how Postmark can help you control this with tags. **Note that we pass a string here, since it becomes a header value. Passing a boolean may or may not work depending on your Rails version.**
40
+
39
41
  ``` ruby
40
42
  class TestMailer < ActionMailer::Base
41
43
 
@@ -44,7 +46,8 @@ class TestMailer < ActionMailer::Base
44
46
  :subject => 'hello',
45
47
  :to => 'sheldon@bigbangtheory.com',
46
48
  :from => 'leonard@bigbangtheory.com',
47
- :tag => 'my-tag'
49
+ :tag => 'my-tag',
50
+ :track_opens => 'true'
48
51
  )
49
52
  end
50
53
 
@@ -129,4 +132,4 @@ Looking for the advanced usage examples? Check out [the documentation](https://g
129
132
 
130
133
  ## Copyright
131
134
 
132
- Copyright © 2010—2013 Wildbit LLC. See LICENSE for details.
135
+ Copyright © 2010—2013 Wildbit LLC. See LICENSE for details.
@@ -1,8 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'postmark', '~> 1.1.0'
3
+ gem 'postmark', '~> 1.3.0'
4
4
  gem 'actionmailer', '~> 3.0.0'
5
5
 
6
6
  group :test do
7
- gem 'rspec', '~> 2.13.0'
8
- end
7
+ gem 'rspec', '~> 2.14.0'
8
+ gem 'mime-types', '~> 1.25.1'
9
+ end
@@ -1,8 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'postmark', '~> 1.1.0'
3
+ gem 'postmark', '~> 1.3.0'
4
4
  gem 'actionmailer', '~> 3.2.0'
5
5
 
6
6
  group :test do
7
- gem 'rspec', '~> 2.13.0'
8
- end
7
+ gem 'rspec', '~> 2.14.0'
8
+ gem 'mime-types', '~> 1.25.1'
9
+ end
@@ -1,8 +1,9 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'postmark', '~> 1.1.0'
3
+ gem 'postmark', '~> 1.3.0'
4
4
  gem 'actionmailer', '~> 4.0.0'
5
5
 
6
6
  group :test do
7
- gem 'rspec', '~> 2.13.0'
8
- end
7
+ gem 'rspec', '~> 2.14.0'
8
+ gem 'mime-types', '~> 1.25.1'
9
+ end
@@ -1,3 +1,3 @@
1
1
  module PostmarkRails
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -17,11 +17,10 @@ Gem::Specification.new do |s|
17
17
  s.rdoc_options = ["--charset=UTF-8"]
18
18
 
19
19
  s.add_dependency('actionmailer', ">= 3.0.0")
20
- s.add_dependency('postmark', "~> 1.2.0")
20
+ s.add_dependency('postmark', "~> 1.3.0")
21
21
  s.add_development_dependency('rake')
22
22
 
23
23
  s.files = `git ls-files`.split("\n")
24
24
  s.test_files = `git ls-files -- spec/*`.split("\n")
25
25
  s.require_paths = ["lib"]
26
26
  end
27
-
@@ -11,6 +11,10 @@ class TestMailer < ActionMailer::Base
11
11
  mail(:tag => 'delivery')
12
12
  end
13
13
 
14
+ def tracked_message
15
+ mail(:track_opens => "true")
16
+ end
17
+
14
18
  def multipart_message
15
19
  mail(:subject => "Your invitation to join Mixlr.") do |format|
16
20
  format.text
@@ -0,0 +1,8 @@
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
4
+ </head>
5
+ <body text="#000000" bgcolor="#FFFFFF">
6
+ <p>HELLO!</p>
7
+ </body>
8
+ </html>
@@ -5,39 +5,48 @@ describe "PostmarkRails3" do
5
5
 
6
6
  it "should allow setting an api key" do
7
7
  ActionMailer::Base.postmark_settings = {:api_key => 'api-key'}
8
- ActionMailer::Base.postmark_settings[:api_key].should == 'api-key'
8
+ expect(ActionMailer::Base.postmark_settings[:api_key]).to eq('api-key')
9
9
  end
10
10
 
11
11
  it "should use postmark for delivery" do
12
- Postmark::ApiClient.should_receive(:new) { api_client }
13
- api_client.should_receive(:deliver_message) do |message|
14
- message.subject.should == "hello"
12
+ expect(Postmark::ApiClient).to receive(:new) { api_client }
13
+ expect(api_client).to receive(:deliver_message) do |message|
14
+ expect(message.subject).to eq("hello")
15
15
  end
16
16
  TestMailer.simple_message.deliver
17
17
  end
18
18
 
19
19
  it "should allow tagging of message" do
20
- Postmark::ApiClient.should_receive(:new) { api_client }
21
- api_client.should_receive(:deliver_message) do |message|
22
- message.tag.to_s.should == "delivery"
20
+ expect(Postmark::ApiClient).to receive(:new) { api_client }
21
+ expect(api_client).to receive(:deliver_message) do |message|
22
+ expect(message.tag.to_s).to eq("delivery")
23
23
  end
24
24
  TestMailer.tagged_message.deliver
25
25
  end
26
26
 
27
+ it "allows to enable open tracking" do
28
+ expect(Postmark::ApiClient).to receive(:new) { api_client }
29
+ expect(api_client).to receive(:deliver_message) do |message|
30
+ expect(message.track_opens).to be_true
31
+ expect(message.to_postmark_hash['TrackOpens']).to be_true
32
+ end
33
+ TestMailer.tracked_message.deliver
34
+ end
35
+
27
36
  it "should work with multipart messages" do
28
- Postmark::ApiClient.should_receive(:new) { api_client }
29
- api_client.should_receive(:deliver_message) do |message|
30
- message.should be_multipart
31
- message.body_text.strip.should == "hello"
32
- message.body_html.strip.should == "<b>hello</b>"
37
+ expect(Postmark::ApiClient).to receive(:new) { api_client }
38
+ expect(api_client).to receive(:deliver_message) do |message|
39
+ expect(message).to be_multipart
40
+ expect(message.body_text.strip).to eq("hello")
41
+ expect(message.body_html.strip).to eq("<b>hello</b>")
33
42
  end
34
43
  TestMailer.multipart_message.deliver
35
44
  end
36
45
 
37
46
  it 'should work with messages containing attachments' do
38
- Postmark::ApiClient.should_receive(:new) { api_client }
39
- api_client.should_receive(:deliver_message) do |message|
40
- message.should have_attachments
47
+ expect(Postmark::ApiClient).to receive(:new) { api_client }
48
+ expect(api_client).to receive(:deliver_message) do |message|
49
+ expect(message).to have_attachments
41
50
  end
42
51
  TestMailer.message_with_attachment.deliver
43
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmark-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petyo Ivanov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-23 00:00:00.000000000 Z
13
+ date: 2014-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionmailer
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: 1.2.0
35
+ version: 1.3.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ~>
41
41
  - !ruby/object:Gem::Version
42
- version: 1.2.0
42
+ version: 1.3.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +86,7 @@ files:
86
86
  - spec/fixtures/views/test_mailer/multipart_message.text.erb
87
87
  - spec/fixtures/views/test_mailer/simple_message.erb
88
88
  - spec/fixtures/views/test_mailer/tagged_message.erb
89
+ - spec/fixtures/views/test_mailer/tracked_message.html.erb
89
90
  - spec/integration/batch_delivery_spec.rb
90
91
  - spec/integration/delivery_spec.rb
91
92
  - spec/postmark-rails_spec.rb
@@ -124,6 +125,7 @@ test_files:
124
125
  - spec/fixtures/views/test_mailer/multipart_message.text.erb
125
126
  - spec/fixtures/views/test_mailer/simple_message.erb
126
127
  - spec/fixtures/views/test_mailer/tagged_message.erb
128
+ - spec/fixtures/views/test_mailer/tracked_message.html.erb
127
129
  - spec/integration/batch_delivery_spec.rb
128
130
  - spec/integration/delivery_spec.rb
129
131
  - spec/postmark-rails_spec.rb