cordial 0.1.9 → 0.1.10
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 +39 -0
- data/lib/cordial/version.rb +1 -1
- 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: 9834a9b273a4f75b86bdb25a525f06a7741f07d9
|
4
|
+
data.tar.gz: f5c9a349b0cbf7d11288315f2dae72f94e2a7880
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e47545046595421b9362b63f6accd536b8770c2101da2b65f700f3d7a0dd239f8c969480075cae940a4ea21d203faf10aabf93ab45753864daf503c00dbf762
|
7
|
+
data.tar.gz: 53bcd80e70a65ac88fc6665c3948fe2d8623828918eb97868ffc6c9bb7c1a3706e21376d449be99f14001af23ae9c63017f1c51fef8ecd1f40e6b6c7eecf4fd3
|
@@ -52,5 +52,44 @@ module Cordial
|
|
52
52
|
}
|
53
53
|
}.to_json)
|
54
54
|
end
|
55
|
+
|
56
|
+
# Sends an automation template.
|
57
|
+
#
|
58
|
+
# @example Usage.
|
59
|
+
# Cordial::AutomationTemplates.send(
|
60
|
+
# key: "promo_01_20_2018",
|
61
|
+
# email: "user@example.com",
|
62
|
+
# order: {
|
63
|
+
# number: "R123456789"
|
64
|
+
# }
|
65
|
+
# )
|
66
|
+
#
|
67
|
+
# @example successful response with unsubscribed user
|
68
|
+
# {"success"=>true, "message"=>"messages sent", "messagecontacts"=>[
|
69
|
+
# {"accepted"=>false, "email"=>"user@example.com", "error"=>"not-subscribed"}
|
70
|
+
# ]}
|
71
|
+
#
|
72
|
+
# @example successful response with subscribed user
|
73
|
+
# {"success"=>true, "message"=>"messages sent", "messagecontacts"=>
|
74
|
+
# [{"accepted"=>true,
|
75
|
+
# "email"=>"user@example.com",
|
76
|
+
# "mcID"=>"h123456:1a1a1a1a1a1:787457457",
|
77
|
+
# "cID"=>"a1a1a1a1a1a1a1a1a1"}
|
78
|
+
# ]}
|
79
|
+
#
|
80
|
+
# @example failed response
|
81
|
+
# {"error"=>"'/v1/automationtemplates//send' is not found."}
|
82
|
+
#
|
83
|
+
def self.send(key:, email:, **args)
|
84
|
+
client.post("/automationtemplates/#{key}/send",
|
85
|
+
body: {
|
86
|
+
to: {
|
87
|
+
contact: {
|
88
|
+
email: email
|
89
|
+
},
|
90
|
+
extVars: {}.compact.merge(args)
|
91
|
+
}
|
92
|
+
}.to_json)
|
93
|
+
end
|
55
94
|
end
|
56
95
|
end
|
data/lib/cordial/version.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.10
|
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-09-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|