tessitura_rest 0.8 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.enc +0 -0
- data/.travis.yml +3 -1
- data/Gemfile +6 -4
- data/lib/tessitura_rest/crm/constituencies.rb +55 -1
- data/lib/tessitura_rest/crm/web_logins.rb +23 -0
- data/lib/tessitura_rest/version.rb +1 -1
- data/lib/tessitura_rest/web/registration.rb +10 -9
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 345f1da7aa6d63a1d827546acc3171483c777ba8ff4a0123d13116223aaf2645
|
4
|
+
data.tar.gz: 9b9dfd0901d4bf2034e94dff62a983af75621c856d199656294a2d37d400bd09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51355fd503e62044b2b5acfec524394f15ae50e8cadce8de93064ad44b9cfa7797cf435fcb38bb5ba5093094eefb2461efa2292754278ca2743cdf8fa2e8410a
|
7
|
+
data.tar.gz: '027897de89660cf0edfeffd16c75c1611dc5df63004351fc2dec684a2ff383e11e2329f3aa1917c655dc2252101c8ac665bb7afd6f09ff3fb073c06a177a2639'
|
data/.env.enc
ADDED
Binary file
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -12,6 +12,60 @@ module Constituencies
|
|
12
12
|
JSON.parse(response.body)
|
13
13
|
end
|
14
14
|
|
15
|
+
def create_constituent_by_snapshot(first_name, last_name, email, phone, constituent_type, source, street1, street2, city, state, zip, country, options={})
|
16
|
+
parameters =
|
17
|
+
{
|
18
|
+
"ConstituentType": {
|
19
|
+
"Id": constituent_type,
|
20
|
+
"Inactive": false,
|
21
|
+
},
|
22
|
+
"FirstName": first_name,
|
23
|
+
"LastName": last_name,
|
24
|
+
"ElectronicAddress": {
|
25
|
+
"Address": email,
|
26
|
+
"ElectronicAddressType": {
|
27
|
+
"Id": 1,
|
28
|
+
},
|
29
|
+
"AllowHtmlFormat": true,
|
30
|
+
"Inactive": false,
|
31
|
+
"AllowMarketing": false,
|
32
|
+
"Months": 'YYYYYYYYYYYY',
|
33
|
+
"PrimaryIndicator": true,
|
34
|
+
},
|
35
|
+
"PrimaryPhoneNumbers":
|
36
|
+
[
|
37
|
+
{
|
38
|
+
"PhoneNumber": phone,
|
39
|
+
"PhoneType":
|
40
|
+
{
|
41
|
+
"Id": 1
|
42
|
+
},
|
43
|
+
},
|
44
|
+
],
|
45
|
+
"OriginalSource": {
|
46
|
+
"Id": source,
|
47
|
+
},
|
48
|
+
"Address": {
|
49
|
+
"AddressType": {
|
50
|
+
"Id": 3,
|
51
|
+
},
|
52
|
+
"City": city,
|
53
|
+
"PostalCode": zip,
|
54
|
+
"State": {
|
55
|
+
"Id": state,
|
56
|
+
},
|
57
|
+
"Street1": street1,
|
58
|
+
"Street2": street2,
|
59
|
+
"Country": {
|
60
|
+
"Id": country,
|
61
|
+
},
|
62
|
+
}
|
63
|
+
}
|
64
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
65
|
+
options.merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' })
|
66
|
+
self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
|
67
|
+
end
|
68
|
+
|
15
69
|
def create_constituencies(constituency, id, options={})
|
16
70
|
parameters =
|
17
71
|
{
|
@@ -26,4 +80,4 @@ module Constituencies
|
|
26
80
|
options.merge!(:body => parameters)
|
27
81
|
response = self.class.post(base_api_endpoint('CRM/Constituencies'), options)
|
28
82
|
end
|
29
|
-
end
|
83
|
+
end
|
@@ -5,4 +5,27 @@ module WebLogins
|
|
5
5
|
response = self.class.get(base_api_endpoint("CRM/WebLogins/Search?emailAddress=#{email}&loginTypeId=#{login_type}"), options)
|
6
6
|
JSON.parse(response.body)
|
7
7
|
end
|
8
|
+
|
9
|
+
def create_web_login(constituent, email_id, email, login_type, primary, temporary, options={})
|
10
|
+
parameters = {
|
11
|
+
'Constituent': {
|
12
|
+
'Id': constituent,
|
13
|
+
},
|
14
|
+
'Email': {
|
15
|
+
'Id': email_id,
|
16
|
+
},
|
17
|
+
'FailedAttempts': 3,
|
18
|
+
'Inactive': false,
|
19
|
+
'Login': email,
|
20
|
+
'LoginType': {
|
21
|
+
'Id': login_type,
|
22
|
+
},
|
23
|
+
'PrimaryIndicator': primary,
|
24
|
+
'TemporaryIndicator': temporary,
|
25
|
+
}
|
26
|
+
options.merge!(basic_auth: @auth, headers: @headers)
|
27
|
+
options.merge!(:body => parameters)
|
28
|
+
self.class.post(base_api_endpoint('CRM/WebLogins'), options)
|
29
|
+
end
|
30
|
+
|
8
31
|
end
|
@@ -7,8 +7,8 @@ module Registration
|
|
7
7
|
'LastName': last_name,
|
8
8
|
'ElectronicAddress': {
|
9
9
|
'Address': email,
|
10
|
+
'AllowMarketing': special_offer || 0,
|
10
11
|
},
|
11
|
-
'EmarketIndicatorId': special_offer,
|
12
12
|
'WebLogin': {
|
13
13
|
'Login': email,
|
14
14
|
'LoginTypeId': 1,
|
@@ -25,15 +25,16 @@ module Registration
|
|
25
25
|
},
|
26
26
|
'ConstituentTypeId': 1,
|
27
27
|
'OriginalSourceId': 3,
|
28
|
-
'Phones':
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
'Phones':
|
29
|
+
[
|
30
|
+
{
|
31
|
+
'PhoneNumber': phone,
|
32
|
+
'PhoneTypeId': 1
|
33
|
+
},
|
34
|
+
],
|
35
|
+
}
|
35
36
|
options.merge!(basic_auth: @auth, headers: @headers)
|
36
|
-
options.merge!(body:
|
37
|
+
options.merge!(:body => parameters.to_json, :headers => {'Content-Type' => 'application/json'})
|
37
38
|
self.class.post(base_api_endpoint("Web/Registration/#{session_key}/Register"), options)
|
38
39
|
end
|
39
40
|
|
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:
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brittany Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -117,6 +117,7 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- ".codeclimate.yml"
|
120
|
+
- ".env.enc"
|
120
121
|
- ".gitignore"
|
121
122
|
- ".rspec"
|
122
123
|
- ".rubocop.yml"
|