postmark 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG.rdoc +4 -0
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/postmark/message_extensions/mail.rb +2 -1
- data/lib/postmark/version.rb +1 -1
- data/spec/unit/postmark/message_extensions/mail_spec.rb +20 -0
- metadata +3 -3
data/.gitignore
CHANGED
data/CHANGELOG.rdoc
CHANGED
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -53,7 +53,8 @@ module Mail
|
|
53
53
|
options["Tag"] = self.tag.to_s if self.tag
|
54
54
|
|
55
55
|
%w(to reply_to cc bcc).each do |field|
|
56
|
-
next unless
|
56
|
+
next unless self.send(field)
|
57
|
+
value = self[field.to_s]
|
57
58
|
options[::Postmark::Inflector.to_postmark(field)] = Array[value].flatten.join(", ")
|
58
59
|
end
|
59
60
|
|
data/lib/postmark/version.rb
CHANGED
@@ -66,6 +66,16 @@ describe Mail::Message do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
let(:mail_message_with_named_addresses) do
|
70
|
+
Mail.new do
|
71
|
+
from "Sheldon <sheldon@bigbangtheory.com>"
|
72
|
+
to "\"Leonard Hofstadter\" <leonard@bigbangtheory.com>"
|
73
|
+
subject "Hello!"
|
74
|
+
body "Hello Sheldon!"
|
75
|
+
reply_to 'Penny "The Neighbor" <penny@bigbangtheory.com>'
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
69
79
|
describe "#html?" do
|
70
80
|
it 'is true for html only email' do
|
71
81
|
mail_html_message.should be_html
|
@@ -201,5 +211,15 @@ describe Mail::Message do
|
|
201
211
|
"TextBody"=>"Hello Sheldon!",
|
202
212
|
"To"=>"lenard@bigbangtheory.com"}
|
203
213
|
end
|
214
|
+
|
215
|
+
it 'converts messages with named addresses correctly' do
|
216
|
+
mail_message_with_named_addresses.to_postmark_hash.should == {
|
217
|
+
"From" => "Sheldon <sheldon@bigbangtheory.com>",
|
218
|
+
"Subject" => "Hello!",
|
219
|
+
"TextBody" => "Hello Sheldon!",
|
220
|
+
"To" => "Leonard Hofstadter <leonard@bigbangtheory.com>",
|
221
|
+
"ReplyTo" => "\"Penny \\\"The Neighbor\\\"\" <penny@bigbangtheory.com>"
|
222
|
+
}
|
223
|
+
end
|
204
224
|
end
|
205
225
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
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: 2013-
|
14
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|
@@ -167,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
segments:
|
169
169
|
- 0
|
170
|
-
hash: -
|
170
|
+
hash: -2741501783398035661
|
171
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
172
|
none: false
|
173
173
|
requirements:
|