spree_sendwithus 2.0.11.9 → 2.0.11.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc11717cfd632b227e9631e1820722ac99c97cd4
4
- data.tar.gz: 505bf284c142c5e5f6d74ee62f8e15890d922ecb
3
+ metadata.gz: a7a620cc934476f6cf59befc3959e978856c2558
4
+ data.tar.gz: d709dd5e8d6e43feac72f1718e28b631a9d7c280
5
5
  SHA512:
6
- metadata.gz: ce6fc150217a8353218bd9487ee4170effde4f58660fbb1fbeee7332e056a19ad4be1251f0c27b7b63faff7ca736c4efc806df6a175d31de2d657a21e8d6bf30
7
- data.tar.gz: ec582d45d41e13deb9d74f645ba9034f0be46df5fe78de7630cb6c535dc7d0f1021263e89bed99291df365954e2fdde26a51c5977a18ddf443b81fda0a95eba2
6
+ metadata.gz: 01aa94279d92af7b5f2e5726fe348a25e45dbd8f249828dc37f4d3762ae78517214479f88f0b8acdfe18cd0007e8ab94eefd0b85df789673214e1b75493f9df4
7
+ data.tar.gz: 6404d8ed3b31cd4b9fac631e47407626f68c62acec6089feaa21637da01eabf0bcaf25b82891b6d3c34a98e47e36e8b714fbe562470ba29472137377fa991da5
@@ -4,7 +4,7 @@ module Spree
4
4
  module SendWithUs
5
5
  class Message
6
6
  attr_reader :to, :from, :email_id, :email_data, :cc, :bcc, :files,
7
- :esp_account
7
+ :esp_account, :tags, :locale
8
8
 
9
9
  def initialize
10
10
  @email_data = {}
@@ -14,6 +14,8 @@ module Spree
14
14
  @bcc = []
15
15
  @files = []
16
16
  @esp_account = Base.esp_account || ""
17
+ @tags = []
18
+ @locale = I18n.default_locale.to_s
17
19
  end
18
20
 
19
21
  def assign(key, value)
@@ -43,20 +45,28 @@ module Spree
43
45
  @files.concat(value)
44
46
  when :esp_account
45
47
  @esp_account = value
48
+ when :tags
49
+ @tags = value
50
+ when :locale
51
+ @locale = value
46
52
  end
47
53
  end
48
54
  end
49
55
 
50
56
  def deliver
51
- ::SendWithUs::Api.new.send_with(
57
+ ::SendWithUs::Api.new.send_email(
52
58
  @email_id,
53
59
  @to,
54
- @email_data,
55
- @from,
56
- @cc,
57
- @bcc,
58
- @files,
59
- @esp_account
60
+ {
61
+ data: @email_data,
62
+ from: @from,
63
+ cc: @cc,
64
+ bcc: @bcc,
65
+ esp_account: @esp_account,
66
+ files: @files,
67
+ tags: @tags,
68
+ locale: @locale
69
+ }
60
70
  )
61
71
  end
62
72
  end
@@ -47,7 +47,9 @@ describe Spree::SendWithUs::Message do
47
47
  cc: ["sean@example.com"],
48
48
  bcc: ["clarke@example.com", "kyria@example.com"],
49
49
  files: ["path/to/file.txt", "../another_file.txt"],
50
- esp_account: "esp_1234"
50
+ esp_account: "esp_1234",
51
+ tags: ['thing'],
52
+ locale: "en"
51
53
  ] }
52
54
 
53
55
  before do
@@ -90,6 +92,14 @@ describe Spree::SendWithUs::Message do
90
92
  it "contains the expected esp account" do
91
93
  expect(subject.esp_account).to eq "esp_1234"
92
94
  end
95
+
96
+ it "contains the expected tags" do
97
+ expect(subject.tags).to eq ['thing']
98
+ end
99
+
100
+ it "contains the expected locale" do
101
+ expect(subject.locale).to eq 'en'
102
+ end
93
103
  end
94
104
 
95
105
  describe "#deliver" do
@@ -97,7 +107,7 @@ describe Spree::SendWithUs::Message do
97
107
 
98
108
  it "calls the send_with_us gem" do
99
109
  allow(SendWithUs::Api).to receive(:new).and_return(api_double)
100
- expect(api_double).to receive(:send_with)
110
+ expect(api_double).to receive(:send_email)
101
111
 
102
112
  subject.deliver
103
113
  end
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_sendwithus'
5
- s.version = '2.0.11.9'
5
+ s.version = '2.0.11.10'
6
6
  s.summary = 'SendWithUs integration'
7
7
  s.license = 'BSD-3'
8
8
 
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.require_paths = ["lib"]
18
18
 
19
19
  s.add_dependency 'spree_core', '~> 2.0.11.beta'
20
- s.add_dependency 'send_with_us', '~> 1.7'
20
+ s.add_dependency 'send_with_us', '~> 1.9'
21
21
 
22
22
  s.add_development_dependency 'rspec-rails', '~> 3.0.0'
23
23
  s.add_development_dependency 'simplecov'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_sendwithus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.11.9
4
+ version: 2.0.11.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - FreeRunning Technologies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-06 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
33
+ version: '1.9'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.7'
40
+ version: '1.9'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec-rails
43
43
  requirement: !ruby/object:Gem::Requirement