customerio-rails 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/customerio-rails/mail.rb +1 -1
- data/lib/customerio-rails/version.rb +1 -1
- data/spec/delivery_spec.rb +12 -0
- data/spec/fixtures/models/test_mailer.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4ff8ea662f0b7c46f92abcb2bff6036c7eb0ceac0a094b1897999de95b84bfb
|
4
|
+
data.tar.gz: 97d58d0c475a0173b3921408be4b617feb410bc9bc524d362de765db1c7ad446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17bda7150e69e7e3f0fcc69f4736309f0eedcb66ebbb8aeb4bc98d46ca7a6ed893a0fd784999e916cbb4ae42c4379d3c3a56daea81cb3831a37ec8fa212493b
|
7
|
+
data.tar.gz: dd577b97550d0104045f51b43c5fe88e42e077337b75f8d4bfd471b871290524e55a8d08a77201f7f2a5af876b4b534fefb35d2a852bbc81d36a58ae956584af
|
@@ -16,7 +16,7 @@ module CustomerioRails
|
|
16
16
|
(Array.wrap(mail.to) + Array.wrap(mail.cc)).compact.each do |to|
|
17
17
|
params = {
|
18
18
|
to: to,
|
19
|
-
from: Array.wrap(mail
|
19
|
+
from: Array.wrap(mail[:from]).first.unparsed_value,
|
20
20
|
subject: mail.subject,
|
21
21
|
reply_to: mail.reply_to,
|
22
22
|
bcc: mail.bcc,
|
data/spec/delivery_spec.rb
CHANGED
@@ -62,6 +62,18 @@ describe 'Delivering messages with customerio-rails' do
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
+
context 'when delivering with a nice from address' do
|
66
|
+
let(:expected_body) do
|
67
|
+
{"to" => "sheldon@bigbangtheory.com", "from" => "Leonard Hofstadter <leonard@bigbangtheory.com>",
|
68
|
+
"subject" => "hello", "headers" => {}, "identifiers" => {"email" => "sheldon@bigbangtheory.com"}, "body" => "hello", "attachments" => {}}
|
69
|
+
end
|
70
|
+
|
71
|
+
it do
|
72
|
+
message = TestMailer.simple_message_with_nice_from
|
73
|
+
message.deliver!
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
65
77
|
context 'when delivering a multipart message' do
|
66
78
|
let(:expected_body) do
|
67
79
|
{ 'to' => 'sheldon@bigbangtheory.com', 'from' => 'leonard@bigbangtheory.com',
|
@@ -7,6 +7,10 @@ class TestMailer < ActionMailer::Base
|
|
7
7
|
mail
|
8
8
|
end
|
9
9
|
|
10
|
+
def simple_message_with_nice_from
|
11
|
+
mail(from: 'Leonard Hofstadter <leonard@bigbangtheory.com>', body: 'hello')
|
12
|
+
end
|
13
|
+
|
10
14
|
def multipart_message
|
11
15
|
mail(subject: "Your invitation to join Mixlr.") do |format|
|
12
16
|
format.text
|