lib/tessitura_rest/crm/constituents.rb in tessitura_rest-1.5.2 vs lib/tessitura_rest/crm/constituents.rb in tessitura_rest-1.5.3
- old
+ new
@@ -58,9 +58,58 @@
options.merge!(basic_auth: @auth, headers: @headers)
options.merge!(:body => parameters.to_json)
self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
end
+ def create_constituent_by_snapshot_v16(first_name, last_name, email, phone, constituent_type, source, street1, street2, city, state, zip, country, options = {})
+ parameters =
+ {
+ 'ConstituentType': {
+ 'Id': constituent_type,
+ },
+ 'FirstName': first_name,
+ 'LastName': last_name,
+ 'OriginalSource': {
+ 'Id': source,
+ },
+ 'PrimaryAddress': {
+ 'AddressType': {
+ 'Id': 3,
+ },
+ 'City': city,
+ 'PostalCode': zip,
+ 'State': {
+ 'Id': state,
+ },
+ 'Street1': street1,
+ 'Street2': street2,
+ 'Country': {
+ 'Id': country,
+ },
+ },
+ 'PrimaryElectronicAddress': {
+ 'Address': email,
+ 'ElectronicAddressType': {
+ 'Id': 1,
+ },
+ 'AllowHtmlFormat': true,
+ 'Inactive': false,
+ 'AllowMarketing': false,
+ 'Months': 'YYYYYYYYYYYY',
+ 'PrimaryIndicator': true,
+ 'PrimaryPhone': {
+ 'PhoneNumber': phone,
+ 'PhoneType': {
+ 'Id': 5,
+ },
+ },
+ },
+ }
+ options.merge!(basic_auth: @auth, headers: @headers)
+ options.merge!(:body => parameters.to_json)
+ self.class.post(base_api_endpoint('CRM/Constituents/Snapshot'), options)
+ end
+
def update_constituent(constituent_id, params, options = {})
current = get_constituent_snapshot(constituent_id)
if is_household?(current)
update_household(params, current)
else
\ No newline at end of file