customerio-rails 0.2.1 → 0.2.2

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: 5adee29125bb8586d4fda950db62af40292c31a993a1690b839ca4e24f17671a
4
- data.tar.gz: 92f387d08d78fdd31a460687a29f28c1e019d954c590da6b2390f1f1b5962215
3
+ metadata.gz: 89e736882d200a4d1285d1172b0a69bebd2b296189dd97381d4a9ac8ac998523
4
+ data.tar.gz: f5c69c0c71d4090da1035f7c0faa13ea03afa355798fcb1bdcda6b05836e93d6
5
5
  SHA512:
6
- metadata.gz: a28b9efc02aa6df47a7cafdaa332ad6f4afa858c14ee6d7ce435a4d275f099120e9c9211605f721d2d3ec75ef9d4268a2de235cb8fdc9af822dc25f35a865d4a
7
- data.tar.gz: 5f287d2ca36b4bfef0f163b600a603d0369d761f85b8dc35a57ef8c69b3465e57955fedf6e7df8a9257a0c62ee90a4c6309044c2c58b2f352a24e8daab53075a
6
+ metadata.gz: b4639bc1ba882ebd9a49d95f0571579a1af4eebf17596660ee4f488f261bdeee05515737fa471182ec7f3c5b063afb64f3fa6babb37833c03fa18aa7dd49ff5d
7
+ data.tar.gz: b171efc85d282dc29480074a3179184ec0451868993937484cf71874ce060d3f66b848a31062413e534245333b8661028589a418fa78e8c0b64c244c9bd471ec
@@ -29,7 +29,14 @@ module CustomerioRails
29
29
  else
30
30
  params[:body] = mail.html_part.body.to_s if mail.html_part
31
31
  params[:body_plain] = mail.text_part.body.to_s if mail.text_part
32
- params[mail.text? ? :body_plain : :body] = mail.body.to_s if !mail.html_part && !mail.text_part
32
+ if params[:body].blank?
33
+ if mail.text?
34
+ params[:body] = ''
35
+ params[:body_plain] = mail.body.to_s if params[:body_plain].blank?
36
+ else
37
+ params[:body] = mail.body.to_s
38
+ end
39
+ end
33
40
  end
34
41
  request = ::Customerio::SendEmailRequest.new(params.compact)
35
42
  mail.attachments.each do |attachment|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CustomerioRails
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
@@ -19,7 +19,7 @@ describe 'Delivering messages with customerio-rails' do
19
19
  context 'when delivering a simple message' do
20
20
  let(:expected_body) do
21
21
  { 'to' => 'sheldon@bigbangtheory.com', 'from' => 'leonard@bigbangtheory.com', 'subject' => 'hello',
22
- 'body_plain' => "hello\n", 'headers' => {}, 'identifiers' => { 'email' => 'sheldon@bigbangtheory.com' }, 'attachments' => {} }
22
+ 'body' => '', 'body_plain' => "hello\n", 'headers' => {}, 'identifiers' => { 'email' => 'sheldon@bigbangtheory.com' }, 'attachments' => {} }
23
23
  end
24
24
 
25
25
  let(:message) { TestMailer.simple_message }
@@ -65,7 +65,7 @@ describe 'Delivering messages with customerio-rails' do
65
65
  context 'when delivering with a nice from address' do
66
66
  let(:expected_body) do
67
67
  {"to" => "sheldon@bigbangtheory.com", "from" => "Leonard Hofstadter <leonard@bigbangtheory.com>",
68
- "subject" => "hello", "headers" => {}, "identifiers" => {"email" => "sheldon@bigbangtheory.com"}, "body_plain" => "hello", "attachments" => {}}
68
+ "subject" => "hello", "headers" => {}, "identifiers" => {"email" => "sheldon@bigbangtheory.com"}, "body" => "", "body_plain" => "hello", "attachments" => {}}
69
69
  end
70
70
 
71
71
  it do
@@ -89,7 +89,7 @@ describe 'Delivering messages with customerio-rails' do
89
89
  context 'when delivering a single part message' do
90
90
  let(:expected_body) do
91
91
  { 'to' => 'sheldon@bigbangtheory.com', 'from' => 'leonard@bigbangtheory.com',
92
- 'subject' => 'Your invitation to join Mixlr.', "body_plain" => "hello\n", 'headers' => {}, 'identifiers' => { 'email' => 'sheldon@bigbangtheory.com' }, 'attachments' => {} }
92
+ 'subject' => 'Your invitation to join Mixlr.', "body" => "", "body_plain" => "hello\n", 'headers' => {}, 'identifiers' => { 'email' => 'sheldon@bigbangtheory.com' }, 'attachments' => {} }
93
93
  end
94
94
 
95
95
  it do
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Utard