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 +4 -4
- data/.travis.yml +1 -5
- data/CHANGELOG.rdoc +5 -0
- data/Gemfile +3 -2
- data/README.md +7 -4
- data/gemfiles/Gemfile.actionmailer-3.0.x +4 -3
- data/gemfiles/Gemfile.actionmailer-3.2.x +4 -3
- data/gemfiles/Gemfile.actionmailer-4.0.x +4 -3
- data/lib/postmark-rails/version.rb +1 -1
- data/postmark-rails.gemspec +1 -2
- data/spec/fixtures/models/test_mailer.rb +4 -0
- data/spec/fixtures/views/test_mailer/tracked_message.html.erb +8 -0
- data/spec/postmark-rails_spec.rb +24 -15
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c62f6b45f10c52806e46eff8aa25d6f45b622b38
|
4
|
+
data.tar.gz: 749d24ff167f6b415a695379cafa1d012eeb385a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/Gemfile
CHANGED
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.
|
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
|
-
##
|
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.
|
data/postmark-rails.gemspec
CHANGED
@@ -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.
|
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
|
-
|
data/spec/postmark-rails_spec.rb
CHANGED
@@ -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].
|
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.
|
13
|
-
api_client.
|
14
|
-
message.subject.
|
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.
|
21
|
-
api_client.
|
22
|
-
message.tag.to_s.
|
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.
|
29
|
-
api_client.
|
30
|
-
|
31
|
-
|
32
|
-
|
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.
|
39
|
-
api_client.
|
40
|
-
message.
|
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.
|
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-
|
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.
|
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.
|
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
|