Module: Mrkt::CrudCustomActivities

Included in:
Client
Defined in:
lib/mrkt/concerns/crud_custom_activities.rb

Instance Method Summary collapse

Instance Method Details

#create_custom_activity(lead_id, activity_type_id, primary_attribute_value, attributes: {}, date: nil) ⇒ Object


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mrkt/concerns/crud_custom_activities.rb', line 10

def create_custom_activity(lead_id, activity_type_id, primary_attribute_value, attributes: {}, date: nil)
  date ||= Time.now
  date = date.utc.iso8601
  converted_attributes = convert_attribute_hash(attributes)

  input = [{
    leadId: lead_id,
    activityDate: date,
    activityTypeId: activity_type_id,
    primaryAttributeValue: primary_attribute_value,
    attributes: converted_attributes
  }]

  post_json('/rest/v1/activities/external.json') do
    { input: input }
  end
end

#get_list_of_custom_activity_typesObject


5
6
7
8
# File 'lib/mrkt/concerns/crud_custom_activities.rb', line 5

def get_list_of_custom_activity_types
  warn 'DEPRECATED: Use #get_activity_types instead of #get_list_of_custom_activity_types!'
  get_activity_types
end