tessitura_rest 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e9a82f5e84441f5d528030a944d4d3537c4b1fe
4
- data.tar.gz: bcac4d17623e8fe9f50ced9f0a6a81d0cbc277ae
3
+ metadata.gz: 9784f20baa001473f50f1e4644078fbd42d7685f
4
+ data.tar.gz: f5931fbc4f509a43c0f5568cc8ed84768b23fdbe
5
5
  SHA512:
6
- metadata.gz: 838f48a3c6b4e74227d935dc897ef5c2b716d3d9e01afd9c969111ca8217febe68c0880ec5ea2e68565bd8835633764136dd5d93e8fa18dbce58fdb16fddab2a
7
- data.tar.gz: 33f375e53c92c31df5f410b4e8748a0a37baf47940058de9dc98edd9117ff0efa17e70d8c885f8bbafecf8ba5a870ba30ded6c9368b4a075d7464923a08a33f0
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
  ```
@@ -14,6 +14,7 @@ class TessituraRest
14
14
  include Constituencies
15
15
  include Countries
16
16
  include Diagnostics
17
+ include Email
17
18
  include GiftCertificates
18
19
  include Issues
19
20
  include LocalProcedure
@@ -15,62 +15,37 @@ module Addresses
15
15
  JSON.parse(response.body)
16
16
  end
17
17
 
18
- def create_address(id, address_type, constituent_id, label, months, postal_code,
19
- street1, state, city, street2=nil, street3=nil, delivery_point=nil, start_date=nil,
20
- end_date=nil, alt_salutation_type={}, options={})
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
- "Id": id,
25
- "AffiliatedConstituent": {
26
- "Id": id
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
- "City": city,
39
- "Constituent": {
40
- "Id": constituent_id
27
+ 'City': city,
28
+ 'Constituent': {
29
+ 'Id': current['Constituent']['Id']
41
30
  },
42
- "DeliveryPoint": "sample string 4",
43
- "EndDate": end_date,
44
- "GeoArea": 1,
45
- "Inactive": true,
46
- "Label": label,
47
- "Months": months,
48
- "NcoaAction": 1,
49
- "NcoaSession": 1,
50
- "PostalCode": postal_code,
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
- "Street1": street1,
65
- "Street2": street2,
66
- "Street3": street3,
67
- "Country": {
68
- "Description": state[:country][:description],
69
- "Id": state[:country][:id],
70
- "Inactive": state[:country][:inactive]
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
@@ -1,3 +1,3 @@
1
1
  class TessituraRest
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  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.1
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-09 00:00:00.000000000 Z
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