tessitura_rest 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/tessitura_rest.rb +1 -0
- data/lib/tessitura_rest/crm/addresses.rb +26 -51
- data/lib/tessitura_rest/custom/email.rb +17 -0
- data/lib/tessitura_rest/version.rb +1 -1
- 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: 9784f20baa001473f50f1e4644078fbd42d7685f
|
4
|
+
data.tar.gz: f5931fbc4f509a43c0f5568cc8ed84768b23fdbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa27efb265202e5abd6868a4058b0455dbff9d45c80a9f69c92563c309e7a144281e5869280253e6b923013d72e65e44b3f52637fb0694e106dfdb3f4f4eae3
|
7
|
+
data.tar.gz: ab356e2824e075709270d0f0fae0a88842ce3fdc8be23b69d6b87bd938a7bb56522b9221c2a3e7c23595be70afd857a6ab69b8600e69de0c93f0909a00020635
|
data/README.md
CHANGED
@@ -65,6 +65,8 @@ followed by the method and arguments you would like to use.
|
|
65
65
|
* GIFT_CARD_NO # a valid gift certificate number that has been purchased
|
66
66
|
* APPLIED_GC # a valid gift certificate number that can be used to purchase products
|
67
67
|
* RETURN_TICKET_KEY # a logged in session that contains a exchangeable ticket
|
68
|
+
* TEMPLATE_ID # a valid email template ID to send Forgot Password emails
|
69
|
+
* PROFILE_ID # a valid email template profile ID
|
68
70
|
|
69
71
|
To run the tests:
|
70
72
|
```
|
data/lib/tessitura_rest.rb
CHANGED
@@ -15,62 +15,37 @@ module Addresses
|
|
15
15
|
JSON.parse(response.body)
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
options.merge!({:basic_auth => @auth})
|
22
|
-
body =
|
18
|
+
def update_address(id, address_type, city, postal_code, state, country, street1, street2, options={})
|
19
|
+
current = get_address(id)
|
20
|
+
parameters =
|
23
21
|
{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
"AltSalutationType": {
|
29
|
-
"Description": "sample string 1",
|
30
|
-
"Id": id,
|
31
|
-
"Inactive": true
|
32
|
-
},
|
33
|
-
"AddressType": {
|
34
|
-
"Description": address_type[:description],
|
35
|
-
"Id": address_type[:id],
|
36
|
-
"Inactive": address_type[:inactive]
|
22
|
+
'Id': id,
|
23
|
+
'UpdatedDateTime': current['UpdatedDateTime'],
|
24
|
+
'AddressType': {
|
25
|
+
'Id': address_type
|
37
26
|
},
|
38
|
-
|
39
|
-
|
40
|
-
|
27
|
+
'City': city,
|
28
|
+
'Constituent': {
|
29
|
+
'Id': current['Constituent']['Id']
|
41
30
|
},
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
"PrimaryIndicator": true,
|
52
|
-
"StartDate": start_date,
|
53
|
-
"State": {
|
54
|
-
"Description": state[:description],
|
55
|
-
"StateCode": state[:state_code],
|
56
|
-
"Id": state[:id],
|
57
|
-
"Inactive": state[:inactive],
|
58
|
-
"Country": {
|
59
|
-
"Description": state[:country][:description],
|
60
|
-
"Id": state[:country][:id],
|
61
|
-
"Inactive": state[:country][:inactive]
|
31
|
+
'Inactive': false,
|
32
|
+
'Label': true,
|
33
|
+
'Months': 'YYYYYYYYYYYY',
|
34
|
+
'PostalCode': postal_code,
|
35
|
+
'PrimaryIndicator': true,
|
36
|
+
'State': {
|
37
|
+
'Id': state,
|
38
|
+
'Country': {
|
39
|
+
'Id': country
|
62
40
|
}
|
63
41
|
},
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}}
|
72
|
-
# response = self.class.post(base_api_endpoint("CRM/Addresses", options)
|
73
|
-
# JSON.parse(response.body)
|
42
|
+
'Street1': street1,
|
43
|
+
'Street2': street2
|
44
|
+
}
|
45
|
+
options.merge!({:basic_auth => @auth})
|
46
|
+
options.merge!(:body => parameters)
|
47
|
+
response = self.class.put(base_api_endpoint("CRM/Addresses/#{id}"), options)
|
48
|
+
JSON.parse(response.body)
|
74
49
|
end
|
75
50
|
|
76
51
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Email
|
2
|
+
|
3
|
+
def send_login_credentials(template_id, email, profile_id, params = '', options={})
|
4
|
+
login_id = get_web_login(email, 1)
|
5
|
+
return false if login_id.empty?
|
6
|
+
parameters =
|
7
|
+
{
|
8
|
+
'TemplateId': template_id,
|
9
|
+
'EmailAddress': email,
|
10
|
+
'EmailProfileId': profile_id
|
11
|
+
}
|
12
|
+
options.merge!({:basic_auth => @auth})
|
13
|
+
options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
|
14
|
+
post = self.class.post(base_api_endpoint("Emails/LoginCredentials/#{login_id.first['Id']}/Send"), options)
|
15
|
+
post.success?
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tessitura_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brittany Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/tessitura_rest/crm/issues.rb
|
136
136
|
- lib/tessitura_rest/crm/phones.rb
|
137
137
|
- lib/tessitura_rest/crm/web_logins.rb
|
138
|
+
- lib/tessitura_rest/custom/email.rb
|
138
139
|
- lib/tessitura_rest/custom/local_procedure.rb
|
139
140
|
- lib/tessitura_rest/diagnostics/diagnostics.rb
|
140
141
|
- lib/tessitura_rest/finance/gift_certificates.rb
|