cordial 0.1.8 → 0.1.9
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/cordial/automation_templates.rb +56 -0
- data/lib/cordial/version.rb +1 -1
- data/lib/cordial.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32486d0b27bda385f28565ae7c1de68b872b8c79
|
4
|
+
data.tar.gz: 1da12854930002459b157d488b06cbb7d18deb15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa46837e8d91ff11933eff14aa5e45620f55b1e52727aed0174c25bb11dacb2e8ceb247a68c752003f2c31563134e41113d27afd54cc68a144e58ad768a63c4
|
7
|
+
data.tar.gz: 6d699f90c7c3be675782efef560f6e411f00c2c1a51b0c47ad5321a1450eed28ef9a6cadd9d9e450a0b8a88c0f0876ca2347869ea31793bf37f573a2e301da55
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Cordial
|
2
|
+
# Wraps all interaction with the Automation Templates resource.
|
3
|
+
# @see https://api.cordial.io/docs/v1/#!/automation_templates
|
4
|
+
class AutomationTemplates
|
5
|
+
include ::HTTParty
|
6
|
+
extend Client
|
7
|
+
|
8
|
+
# Create a new message template.
|
9
|
+
#
|
10
|
+
# @example Usage.
|
11
|
+
# Cordial::AutomationTemplates.create(
|
12
|
+
# key: "promo_01_20_2018",
|
13
|
+
# name: "promo_01_20_2018",
|
14
|
+
# channel: "email",
|
15
|
+
# classification: "promotional",
|
16
|
+
# base_aggregation: "hourly",
|
17
|
+
# headers:{
|
18
|
+
# subject_email: "One Day Only Sale",
|
19
|
+
# from_email: "info@example.com",
|
20
|
+
# reply_email: "info@example.com",
|
21
|
+
# from_description: "Promotions Team"
|
22
|
+
# },
|
23
|
+
# content:{
|
24
|
+
# text: "<div>Hello World</div>"
|
25
|
+
# }
|
26
|
+
# )
|
27
|
+
#
|
28
|
+
# @example successful response
|
29
|
+
# {"success"=>true, "message"=>"record created"}
|
30
|
+
#
|
31
|
+
# @example failed response
|
32
|
+
# {"error"=>true, "messages"=>"KEY must be unique"}
|
33
|
+
#
|
34
|
+
def self.create(key:, name:, channel:, classification:, base_aggregation:, headers:, content:)
|
35
|
+
client.post('/automationtemplates',
|
36
|
+
body: {
|
37
|
+
key: key,
|
38
|
+
name: name,
|
39
|
+
channel: channel,
|
40
|
+
classification: classification,
|
41
|
+
baseAggregation: base_aggregation,
|
42
|
+
message: {
|
43
|
+
headers: {
|
44
|
+
subject: headers[:subject_email],
|
45
|
+
fromEmail: headers[:from_email],
|
46
|
+
replyEmail: headers[:reply_email],
|
47
|
+
fromDesc: headers[:from_description]
|
48
|
+
},
|
49
|
+
content: {
|
50
|
+
"text/html": content[:text]
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}.to_json)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/cordial/version.rb
CHANGED
data/lib/cordial.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cordial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Hood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- bin/setup
|
157
157
|
- cordial.gemspec
|
158
158
|
- lib/cordial.rb
|
159
|
+
- lib/cordial/automation_templates.rb
|
159
160
|
- lib/cordial/client.rb
|
160
161
|
- lib/cordial/contacts.rb
|
161
162
|
- lib/cordial/orders.rb
|