emarsys 0.3.0 → 0.3.1
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/CHANGELOG.md +5 -1
- data/README.md +8 -0
- data/lib/emarsys/data_objects/export.rb +17 -0
- data/lib/emarsys/version.rb +1 -1
- data/spec/emarsys/data_objects/export_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1943af483f1ff4babeca7459c1cf9abfe6f72310
|
4
|
+
data.tar.gz: b387277b486845a2a7c1cdcdedf0d40ff7fdb707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b03ccb71acbabb401381ae3883f204530f168771713fa075c46faf320d8edef785869b4fffc91134cf25c3829c29dc0acc33950815c13eb973d5d423351a50da
|
7
|
+
data.tar.gz: 01336632d7109dcd761f1922f5b07da6440f806edf56546a6a3d5cb520b3cd9517caab4104442190043ccf4ac6a5f8e233dcddafb9f714d3f375f976aa3fddbc
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## v0.3.1
|
4
|
+
|
5
|
+
* Export segment ([#31](https://github.com/Absolventa/emarsys-rb/pull/31))
|
6
|
+
|
7
|
+
## v0.3.0
|
4
8
|
|
5
9
|
* Return response, not just (parsed) body of it ([#29](https://github.com/Absolventa/emarsys-rb/pull/29)). To migrate existing code, you need to call `#data` on the
|
6
10
|
response object.
|
data/README.md
CHANGED
@@ -54,6 +54,14 @@ Emarsys.configure(account: :bar) do |c|
|
|
54
54
|
end
|
55
55
|
```
|
56
56
|
|
57
|
+
When your application uses only one Emarsys account you will need to add:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
Emarsys.allow_default_configuration = true
|
61
|
+
```
|
62
|
+
|
63
|
+
to your configuration.
|
64
|
+
|
57
65
|
### Field Mapping
|
58
66
|
|
59
67
|
As said before, Emarsys loves IDs. For using an API, they are evil. This gem provides
|
@@ -31,6 +31,23 @@ module Emarsys
|
|
31
31
|
params.merge!(:limit => limit) if limit
|
32
32
|
get account, "export/#{id}/data", params
|
33
33
|
end
|
34
|
+
|
35
|
+
# Export a segment
|
36
|
+
#
|
37
|
+
# @param filter [Integer] The segment ID
|
38
|
+
# @option distribution_method [String] ftp, sftp, local or mail
|
39
|
+
# @option contact_fields [Array] Contact field IDs to export
|
40
|
+
# @return [Hash] Result data
|
41
|
+
# @example
|
42
|
+
# Emarsys::Export.filter(filter: 123, distribution_method: 'local', contact_fields: [1, 3, 106533])
|
43
|
+
def filter(filter:, distribution_method:, contact_fields:, account: nil, **params)
|
44
|
+
params.merge!(
|
45
|
+
filter: filter,
|
46
|
+
distribution_method: distribution_method,
|
47
|
+
contact_fields: contact_fields
|
48
|
+
)
|
49
|
+
post account, "export/filter", params
|
50
|
+
end
|
34
51
|
end
|
35
52
|
|
36
53
|
end
|
data/lib/emarsys/version.rb
CHANGED
@@ -16,4 +16,16 @@ describe Emarsys::Export do
|
|
16
16
|
).to have_been_requested.once
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
describe ".filter" do
|
21
|
+
it "requests a single export" do
|
22
|
+
stub = stub_request(:post, "https://api.emarsys.net/api/v2/export/filter").to_return(standard_return_body)
|
23
|
+
Emarsys::Export.filter(
|
24
|
+
filter: 123,
|
25
|
+
distribution_method: 'local',
|
26
|
+
contact_fields: [1, 3]
|
27
|
+
)
|
28
|
+
expect(stub).to have_been_requested.once
|
29
|
+
end
|
30
|
+
end
|
19
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emarsys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Schoppmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|