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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67c845f6f2c71391044755e3412a1674f24a129dab76f841455eeebf135fc897
4
- data.tar.gz: 21785d8a8cd965fa463ce6ebbc2ca8c3336bff9cd1b195a923ebebf129025bd8
3
+ metadata.gz: e4ff8ea662f0b7c46f92abcb2bff6036c7eb0ceac0a094b1897999de95b84bfb
4
+ data.tar.gz: 97d58d0c475a0173b3921408be4b617feb410bc9bc524d362de765db1c7ad446
5
5
  SHA512:
6
- metadata.gz: f07811ee4d2cc6e212327f39537ce20a7ac681af323dd0b249d8fcd5cf185ca40d4b4e03f94599b413ff706e10e807b59d303755c5aac5296952ce1527233a66
7
- data.tar.gz: 30664d979cba3887204f723ecccd2506360b871061f8d6f31a23dfb0ccc4cc97981ff0789092100610aa92c6c5a7ecaf03fe2cbab94723b92f1ffdf1cbfd01f2
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.from).first,
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CustomerioRails
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: customerio-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Utard