postmark-rails 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/README.md +2 -2
- data/gemfiles/Gemfile.actionmailer-3.0.x +1 -1
- data/gemfiles/Gemfile.actionmailer-3.2.x +1 -1
- data/gemfiles/Gemfile.actionmailer-4.0.x +1 -1
- data/lib/postmark-rails/version.rb +1 -1
- data/postmark-rails.gemspec +1 -1
- data/spec/fixtures/models/test_mailer.rb +13 -1
- data/spec/fixtures/views/test_mailer/message_with_inline_image.html.erb +8 -0
- data/spec/integration/delivery_spec.rb +12 -0
- metadata +9 -7
data/CHANGELOG.rdoc
CHANGED
data/README.md
CHANGED
@@ -59,12 +59,12 @@ The Postmark gem is compatible with [ActionMailer attachments API](http://api.ru
|
|
59
59
|
|
60
60
|
The legacy `:postmark_attachments` attribute is *no longer supported* on Rails 3.2.13 and above.
|
61
61
|
|
62
|
-
|
63
62
|
``` ruby
|
64
63
|
class TestMailer < ActionMailer::Base
|
65
64
|
|
66
65
|
def message_with_attachment
|
67
|
-
attachments['
|
66
|
+
attachments.inline['logo.png'] = File.read("/path/to/image") # Inline image
|
67
|
+
attachments['42.jpg'] = File.read("/path/to/file") # Attached file
|
68
68
|
mail(
|
69
69
|
:subject => 'hello',
|
70
70
|
:to => 'sheldon@bigbangtheory.com',
|
data/postmark-rails.gemspec
CHANGED
@@ -17,7 +17,7 @@ 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.0")
|
20
|
+
s.add_dependency('postmark', "~> 1.1.0")
|
21
21
|
s.add_development_dependency('rake')
|
22
22
|
|
23
23
|
s.files = `git ls-files`.split("\n")
|
@@ -19,7 +19,19 @@ class TestMailer < ActionMailer::Base
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def message_with_attachment
|
22
|
-
attachments['empty.gif'] = File.
|
22
|
+
attachments['empty.gif'] = File.read(image_file)
|
23
23
|
mail(:subject => "Message with attachment.")
|
24
24
|
end
|
25
|
+
|
26
|
+
def message_with_inline_image
|
27
|
+
attachments.inline['empty.gif'] = File.read(image_file)
|
28
|
+
mail(:subject => "Message with inline image.")
|
29
|
+
end
|
30
|
+
|
31
|
+
protected
|
32
|
+
|
33
|
+
def image_file
|
34
|
+
File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'empty.gif')
|
35
|
+
end
|
36
|
+
|
25
37
|
end
|
@@ -27,7 +27,19 @@ describe "Delivering messages with postmark-rails" do
|
|
27
27
|
|
28
28
|
it 'delivers a message with attachments' do
|
29
29
|
message = TestMailer.message_with_attachment
|
30
|
+
request = message.to_postmark_hash
|
30
31
|
|
32
|
+
expect(request['Attachments'].count).not_to be_zero
|
31
33
|
expect { message.deliver }.to change{message.delivered?}.to(true)
|
32
34
|
end
|
35
|
+
|
36
|
+
it 'delivers a message with inline image' do
|
37
|
+
message = TestMailer.message_with_inline_image
|
38
|
+
request = message.to_postmark_hash
|
39
|
+
|
40
|
+
expect(request['Attachments'].count).not_to be_zero
|
41
|
+
expect(request['Attachments'].first).to have_key('ContentID')
|
42
|
+
expect { message.deliver }.to change{message.delivered?}.to(true)
|
43
|
+
end
|
44
|
+
|
33
45
|
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.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: actionmailer
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ~>
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 1.1.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.1.0
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rake
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- spec/fixtures/empty.gif
|
89
89
|
- spec/fixtures/models/test_mailer.rb
|
90
90
|
- spec/fixtures/views/test_mailer/message_with_attachment.erb
|
91
|
+
- spec/fixtures/views/test_mailer/message_with_inline_image.html.erb
|
91
92
|
- spec/fixtures/views/test_mailer/multipart_message.html.erb
|
92
93
|
- spec/fixtures/views/test_mailer/multipart_message.text.erb
|
93
94
|
- spec/fixtures/views/test_mailer/simple_message.erb
|
@@ -112,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
113
|
version: '0'
|
113
114
|
segments:
|
114
115
|
- 0
|
115
|
-
hash: -
|
116
|
+
hash: -330314063313697009
|
116
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
118
|
none: false
|
118
119
|
requirements:
|
@@ -121,10 +122,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
122
|
version: '0'
|
122
123
|
segments:
|
123
124
|
- 0
|
124
|
-
hash: -
|
125
|
+
hash: -330314063313697009
|
125
126
|
requirements: []
|
126
127
|
rubyforge_project:
|
127
|
-
rubygems_version: 1.8.
|
128
|
+
rubygems_version: 1.8.23
|
128
129
|
signing_key:
|
129
130
|
specification_version: 3
|
130
131
|
summary: Postmark adapter for ActionMailer
|
@@ -132,6 +133,7 @@ test_files:
|
|
132
133
|
- spec/fixtures/empty.gif
|
133
134
|
- spec/fixtures/models/test_mailer.rb
|
134
135
|
- spec/fixtures/views/test_mailer/message_with_attachment.erb
|
136
|
+
- spec/fixtures/views/test_mailer/message_with_inline_image.html.erb
|
135
137
|
- spec/fixtures/views/test_mailer/multipart_message.html.erb
|
136
138
|
- spec/fixtures/views/test_mailer/multipart_message.text.erb
|
137
139
|
- spec/fixtures/views/test_mailer/simple_message.erb
|