mints 0.0.27 → 0.0.29
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 +4 -4
- data/Gemfile +2 -1
- data/lib/client.rb +287 -385
- data/lib/contact/config/appointments.rb +201 -0
- data/lib/contact/config/config.rb +7 -0
- data/lib/contact/content/content.rb +7 -0
- data/lib/contact/content/conversations.rb +121 -0
- data/lib/contact/ecommerce/ecommerce.rb +12 -0
- data/lib/contact/ecommerce/order_items.rb +19 -0
- data/lib/contact/ecommerce/order_items_groups.rb +95 -0
- data/lib/contact/ecommerce/orders.rb +133 -0
- data/lib/contact.rb +57 -607
- data/lib/errors.rb +4 -2
- data/lib/generators/mints_assets_controller.rb +4 -1
- data/lib/generators/mints_config.yml.erb +0 -2
- data/lib/generators/mints_contact_controller.rb +4 -1
- data/lib/generators/mints_files_generator.rb +16 -13
- data/lib/generators/mints_link.rb +9 -6
- data/lib/generators/mints_public_controller.rb +4 -1
- data/lib/generators/mints_user_controller.rb +3 -0
- data/lib/generators/short_link_controller.rb +4 -1
- data/lib/mints/controllers/admin_base_controller.rb +5 -3
- data/lib/mints/controllers/base_api_controller.rb +6 -4
- data/lib/mints/controllers/base_controller.rb +5 -3
- data/lib/mints/controllers/concerns/mints_clients.rb +4 -2
- data/lib/mints/controllers/concerns/read_config_file.rb +3 -1
- data/lib/mints/controllers/contact_api_controller.rb +12 -10
- data/lib/mints/controllers/public_api_controller.rb +10 -8
- data/lib/mints/controllers/user_api_controller.rb +11 -9
- data/lib/mints/helpers/contact_auth_helper.rb +3 -1
- data/lib/mints/helpers/mints_helper.rb +39 -38
- data/lib/mints/helpers/proxy_controllers_methods.rb +24 -24
- data/lib/mints/helpers/user_auth_helper.rb +5 -3
- data/lib/mints.rb +12 -10
- data/lib/pub.rb +75 -93
- data/lib/user/config/api_keys.rb +63 -61
- data/lib/user/config/appointments.rb +217 -215
- data/lib/user/config/attribute_groups.rb +74 -72
- data/lib/user/config/attributes.rb +83 -81
- data/lib/user/config/calendars.rb +88 -86
- data/lib/user/config/config.rb +31 -63
- data/lib/user/config/public_folders.rb +105 -104
- data/lib/user/config/relationships.rb +135 -132
- data/lib/user/config/roles.rb +76 -79
- data/lib/user/config/seeds.rb +52 -51
- data/lib/user/config/system_settings.rb +50 -49
- data/lib/user/config/tags.rb +57 -59
- data/lib/user/config/taxonomies.rb +115 -119
- data/lib/user/config/teams.rb +69 -68
- data/lib/user/config/users.rb +72 -71
- data/lib/user/contacts/contacts.rb +21 -20
- data/lib/user/content/assets.rb +275 -280
- data/lib/user/content/content.rb +236 -235
- data/lib/user/content/content_instances.rb +138 -138
- data/lib/user/content/content_templates.rb +105 -103
- data/lib/user/content/conversations.rb +195 -193
- data/lib/user/content/dam.rb +85 -80
- data/lib/user/content/forms.rb +231 -233
- data/lib/user/content/message_templates.rb +154 -151
- data/lib/user/content/messages.rb +89 -87
- data/lib/user/content/pages.rb +84 -82
- data/lib/user/content/stories.rb +101 -101
- data/lib/user/content/story_templates.rb +90 -88
- data/lib/user/content/story_versions.rb +117 -117
- data/lib/user/crm/companies.rb +106 -106
- data/lib/user/crm/contacts.rb +287 -292
- data/lib/user/crm/crm.rb +21 -19
- data/lib/user/crm/deals.rb +105 -103
- data/lib/user/crm/favorites.rb +16 -13
- data/lib/user/crm/segments.rb +123 -123
- data/lib/user/crm/users.rb +22 -20
- data/lib/user/crm/workflow_step_objects.rb +86 -84
- data/lib/user/crm/workflow_steps.rb +47 -45
- data/lib/user/crm/workflows.rb +67 -65
- data/lib/user/ecommerce/ecommerce.rb +29 -27
- data/lib/user/ecommerce/item_prices.rb +84 -81
- data/lib/user/ecommerce/locations.rb +162 -160
- data/lib/user/ecommerce/order_items_groups.rb +110 -106
- data/lib/user/ecommerce/order_statuses.rb +26 -24
- data/lib/user/ecommerce/orders.rb +253 -246
- data/lib/user/ecommerce/price_lists.rb +70 -68
- data/lib/user/ecommerce/product_templates.rb +101 -99
- data/lib/user/ecommerce/product_variations.rb +124 -120
- data/lib/user/ecommerce/products.rb +162 -159
- data/lib/user/ecommerce/skus.rb +87 -85
- data/lib/user/ecommerce/taxes.rb +81 -79
- data/lib/user/ecommerce/variant_options.rb +68 -66
- data/lib/user/ecommerce/variant_values.rb +71 -69
- data/lib/user/helpers/helpers.rb +104 -101
- data/lib/user/helpers/object_activities.rb +80 -78
- data/lib/user/helpers/object_folders.rb +78 -76
- data/lib/user/helpers/user_folders.rb +79 -77
- data/lib/user/marketing/marketing.rb +116 -113
- data/lib/user/profile/profile.rb +96 -103
- data/lib/user.rb +32 -41
- metadata +50 -43
- data/lib/user/config/importers.rb +0 -184
data/lib/user/crm/contacts.rb
CHANGED
|
@@ -1,312 +1,307 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Contacts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
##
|
|
5
|
+
# == Contacts
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
##
|
|
9
|
+
# === Get contacts support data.
|
|
10
|
+
#
|
|
11
|
+
# ==== Example
|
|
12
|
+
# @data = @mints_user.get_contacts_support_data
|
|
13
|
+
def get_contacts_support_data
|
|
14
|
+
@client.raw('get', '/crm/contacts/support-data')
|
|
15
|
+
end
|
|
5
16
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
# ==== Parameters
|
|
20
|
-
# id:: (Integer) -- Contact id.
|
|
21
|
-
#
|
|
22
|
-
# ==== Example
|
|
23
|
-
# @data = @mints_user.get_online_activity(5)
|
|
24
|
-
def get_online_activity(id)
|
|
25
|
-
@client.raw("get", "/crm/contacts/#{id}/online-activity")
|
|
26
|
-
end
|
|
17
|
+
##
|
|
18
|
+
# === Get online activity.
|
|
19
|
+
# Get online activity of a contact.
|
|
20
|
+
#
|
|
21
|
+
# ==== Parameters
|
|
22
|
+
# id:: (Integer) -- Contact id.
|
|
23
|
+
#
|
|
24
|
+
# ==== Example
|
|
25
|
+
# @data = @mints_user.get_online_activity(5)
|
|
26
|
+
def get_online_activity(id)
|
|
27
|
+
@client.raw('get', "/crm/contacts/#{id}/online-activity")
|
|
28
|
+
end
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
30
|
+
##
|
|
31
|
+
# === Get contacts.
|
|
32
|
+
# Get a collection of contacts.
|
|
33
|
+
#
|
|
34
|
+
# ==== Parameters
|
|
35
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
36
|
+
# use_post:: (Boolean) -- Variable to determine if the request is by 'post' or 'get' functions.
|
|
37
|
+
#
|
|
38
|
+
# ==== First Example
|
|
39
|
+
# @data = @mints_user.get_contacts
|
|
40
|
+
#
|
|
41
|
+
# ==== Second Example
|
|
42
|
+
# options = {
|
|
43
|
+
# sort: 'id',
|
|
44
|
+
# 'fields[contacts]': 'id, email'
|
|
45
|
+
# }
|
|
46
|
+
# @data = @mints_user.get_contacts(options)
|
|
47
|
+
#
|
|
48
|
+
# ==== Third Example
|
|
49
|
+
# options = {
|
|
50
|
+
# sort: 'id',
|
|
51
|
+
# 'fields[contacts]': 'id, email'
|
|
52
|
+
# }
|
|
53
|
+
# @data = @mints_user.get_contacts(options, true)
|
|
54
|
+
def get_contacts(options = nil, use_post = true)
|
|
55
|
+
get_query_results('/crm/contacts', options, use_post)
|
|
56
|
+
end
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
##
|
|
59
|
+
# === Get contact.
|
|
60
|
+
# Get a contact data.
|
|
61
|
+
#
|
|
62
|
+
# ==== Parameters
|
|
63
|
+
# id:: (Integer) -- Contact id.
|
|
64
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
65
|
+
#
|
|
66
|
+
# ==== First Example
|
|
67
|
+
# @data = @mints_user.get_contact(5)
|
|
68
|
+
#
|
|
69
|
+
# ==== Second Example
|
|
70
|
+
# options = {
|
|
71
|
+
# sort: 'id',
|
|
72
|
+
# 'fields[contacts]': 'id, email'
|
|
73
|
+
# }
|
|
74
|
+
# @data = @mints_user.get_contact(5, options)
|
|
75
|
+
def get_contact(id, options = nil)
|
|
76
|
+
@client.raw('get', "/crm/contacts/#{id}", options)
|
|
77
|
+
end
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
79
|
+
##
|
|
80
|
+
# === Create contact.
|
|
81
|
+
# Create a contact with data.
|
|
82
|
+
#
|
|
83
|
+
# ==== Parameters
|
|
84
|
+
# data:: (Hash) -- Data to be submitted.
|
|
85
|
+
#
|
|
86
|
+
# ==== Example
|
|
87
|
+
# data = {
|
|
88
|
+
# email: 'email@example.com',
|
|
89
|
+
# given_name: 'Given Name',
|
|
90
|
+
# last_name: 'Last Name',
|
|
91
|
+
# password: '123456'
|
|
92
|
+
# }
|
|
93
|
+
# @data = @mints_user.create_contact(data)
|
|
94
|
+
def create_contact(data, options = nil)
|
|
95
|
+
@client.raw('post', '/crm/contacts', options, data_transform(data))
|
|
96
|
+
end
|
|
95
97
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
98
|
+
##
|
|
99
|
+
# === Update contact.
|
|
100
|
+
# Update contact data.
|
|
101
|
+
#
|
|
102
|
+
# ==== Parameters
|
|
103
|
+
# id:: (Integer) -- Contact id.
|
|
104
|
+
# data:: (Hash) -- Data to be submitted.
|
|
105
|
+
#
|
|
106
|
+
# ==== Example
|
|
107
|
+
# data = {
|
|
108
|
+
# email: 'email_modified@example.com',
|
|
109
|
+
# company_id: 3
|
|
110
|
+
# }
|
|
111
|
+
# @data = @mints_user.update_contact(65, data)
|
|
112
|
+
def update_contact(id, data, options = nil)
|
|
113
|
+
@client.raw('put', "/crm/contacts/#{id}", options, data_transform(data))
|
|
114
|
+
end
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
##
|
|
117
|
+
# === Get contact deals.
|
|
118
|
+
# Get a collection of deals of a contact.
|
|
119
|
+
#
|
|
120
|
+
# ==== Parameters
|
|
121
|
+
# contact_id:: (Integer) -- Contact id.
|
|
122
|
+
#
|
|
123
|
+
# ==== Example
|
|
124
|
+
# @data = @mints_user.get_contact_deal(5)
|
|
125
|
+
def get_contact_deal(contact_id)
|
|
126
|
+
@client.raw('get', "/crm/contacts/#{contact_id}/deals")
|
|
127
|
+
end
|
|
126
128
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
@client.raw("post", "/crm/contacts/#{contact_id}/deals", nil, data)
|
|
142
|
-
end
|
|
129
|
+
##
|
|
130
|
+
# === Create contact deal.
|
|
131
|
+
# Create a contact deal with data.
|
|
132
|
+
#
|
|
133
|
+
# ==== Parameters
|
|
134
|
+
# contact_id:: (Integer) -- Contact id.
|
|
135
|
+
# data:: (Hash) -- Data to be submitted.
|
|
136
|
+
#
|
|
137
|
+
# ==== Example
|
|
138
|
+
# data = { deal_id: 6 }
|
|
139
|
+
# @data = @mints_user.create_contact_deal(5, data.to_json)
|
|
140
|
+
def create_contact_deal(contact_id, data)
|
|
141
|
+
@client.raw('post', "/crm/contacts/#{contact_id}/deals", nil, data)
|
|
142
|
+
end
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
144
|
+
##
|
|
145
|
+
# === Delete contact deal.
|
|
146
|
+
# Delete a contact deal with data.
|
|
147
|
+
#
|
|
148
|
+
# ==== Parameters
|
|
149
|
+
# contact_id:: (Integer) -- Contact id.
|
|
150
|
+
# deal_id:: (Integer) -- Deal id.
|
|
151
|
+
#
|
|
152
|
+
# ==== Example
|
|
153
|
+
# @data = @mints_user.delete_contact_deal(5, 100)
|
|
154
|
+
def delete_contact_deal(contact_id, deal_id)
|
|
155
|
+
@client.raw('delete', "/crm/contacts/#{contact_id}/deals/#{deal_id}")
|
|
156
|
+
end
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
158
|
+
##
|
|
159
|
+
# === Get contact user.
|
|
160
|
+
# Get user data of a contact.
|
|
161
|
+
#
|
|
162
|
+
# ==== Parameters
|
|
163
|
+
# TODO: Replace Resource collection options url
|
|
164
|
+
# contact_id:: (Integer) -- Contact id.
|
|
165
|
+
# options:: (Hash) -- List of Resource Collection Options shown above can be used as parameter.
|
|
166
|
+
#
|
|
167
|
+
# ==== Example
|
|
168
|
+
# @data = @mints_user.get_contact_user(66)
|
|
169
|
+
def get_contact_user(contact_id)
|
|
170
|
+
@client.raw('get', "/crm/contacts/#{contact_id}/users")
|
|
171
|
+
end
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
@client.raw("post", "/crm/contacts/#{contact_id}/users", nil, data)
|
|
188
|
-
end
|
|
173
|
+
##
|
|
174
|
+
# === Create contact user.
|
|
175
|
+
# Relate a contact with an user.
|
|
176
|
+
#
|
|
177
|
+
# ==== Parameters
|
|
178
|
+
# contact_id:: (Integer) -- Contact id.
|
|
179
|
+
# data:: (Hash) -- Data to be submitted.
|
|
180
|
+
#
|
|
181
|
+
# ==== Example
|
|
182
|
+
# data = { user_id: 9 }
|
|
183
|
+
# @data = @mints_user.create_contact_user(66, data.to_json)
|
|
184
|
+
def create_contact_user(contact_id, data)
|
|
185
|
+
@client.raw('post', "/crm/contacts/#{contact_id}/users", nil, data)
|
|
186
|
+
end
|
|
189
187
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
188
|
+
##
|
|
189
|
+
# === Delete contact user.
|
|
190
|
+
# Delete a relationship between a contact and an user.
|
|
191
|
+
#
|
|
192
|
+
# ==== Parameters
|
|
193
|
+
# contact_id:: (Integer) -- Contact id.
|
|
194
|
+
# id:: (Integer) -- User id.
|
|
195
|
+
#
|
|
196
|
+
# ==== Example
|
|
197
|
+
# @data = @mints_user.delete_contact_user(153, 9)
|
|
198
|
+
def delete_contact_user(contact_id, id)
|
|
199
|
+
@client.raw('delete', "/crm/contacts/#{contact_id}/users/#{id}")
|
|
200
|
+
end
|
|
203
201
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
202
|
+
##
|
|
203
|
+
# === Get contact segments.
|
|
204
|
+
# Get segments of a contact.
|
|
205
|
+
#
|
|
206
|
+
# ==== Parameters
|
|
207
|
+
# contact_id:: (Integer) -- Contact id.
|
|
208
|
+
#
|
|
209
|
+
# ==== Example
|
|
210
|
+
# @data = @mints_user.get_contact_segments(1)
|
|
211
|
+
def get_contact_segments(contact_id)
|
|
212
|
+
@client.raw('get', "/crm/contacts/#{contact_id}/segments")
|
|
213
|
+
end
|
|
216
214
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
215
|
+
##
|
|
216
|
+
# === Get contact submissions.
|
|
217
|
+
# Get submissions of a contact.
|
|
218
|
+
#
|
|
219
|
+
# ==== Parameters
|
|
220
|
+
# contact_id:: (Integer) -- Contact id.
|
|
221
|
+
#
|
|
222
|
+
# ==== Example
|
|
223
|
+
# @data = @mints_user.get_contact_submissions(146)
|
|
224
|
+
def get_contact_submissions(contact_id)
|
|
225
|
+
@client.raw('get', "/crm/contacts/#{contact_id}/submissions")
|
|
226
|
+
end
|
|
229
227
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
228
|
+
##
|
|
229
|
+
# === Get contact tags.
|
|
230
|
+
# Get tags of a contact.
|
|
231
|
+
#
|
|
232
|
+
# ==== Parameters
|
|
233
|
+
# contact_id:: (Integer) -- Contact id.
|
|
234
|
+
#
|
|
235
|
+
# ==== Example
|
|
236
|
+
# @data = @mints_user.get_contact_tags(1)
|
|
237
|
+
def get_contact_tags(contact_id)
|
|
238
|
+
@client.raw('get', "/crm/contacts/#{contact_id}/tags")
|
|
239
|
+
end
|
|
242
240
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
241
|
+
##
|
|
242
|
+
# === Get contact magic links.
|
|
243
|
+
# Get magic links of a contact.
|
|
244
|
+
#
|
|
245
|
+
# ==== Parameters
|
|
246
|
+
# contact_id:: (Integer) -- Contact id.
|
|
247
|
+
#
|
|
248
|
+
# ==== Example
|
|
249
|
+
# @data = @mints_user.get_contact_magic_links(150)
|
|
250
|
+
def get_contact_magic_links(contact_id)
|
|
251
|
+
@client.raw('get', "/crm/contacts/#{contact_id}/magic-links")
|
|
252
|
+
end
|
|
255
253
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
@client.raw("post", "/crm/contacts/#{id}/merge", nil, data_transform(data))
|
|
271
|
-
end
|
|
254
|
+
##
|
|
255
|
+
# === Create contact merge.
|
|
256
|
+
# Merge contacts.
|
|
257
|
+
#
|
|
258
|
+
# ==== Parameters
|
|
259
|
+
# id:: (Integer) -- Contact id.
|
|
260
|
+
# data:: (Hash) -- Data to be submitted. It contains ids to be merged.
|
|
261
|
+
#
|
|
262
|
+
# ==== Example
|
|
263
|
+
# data = { mergeContactIds: [152] }
|
|
264
|
+
# @data = @mints_user.merge_contacts(151, data)
|
|
265
|
+
def merge_contacts(id, data)
|
|
266
|
+
@client.raw('post', "/crm/contacts/#{id}/merge", nil, data_transform(data))
|
|
267
|
+
end
|
|
272
268
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
269
|
+
##
|
|
270
|
+
# === Send magic links.
|
|
271
|
+
# Send magic links to contacts.
|
|
272
|
+
#
|
|
273
|
+
# ==== Parameters
|
|
274
|
+
# data:: (Hash) -- Data to be submitted.
|
|
275
|
+
#
|
|
276
|
+
# ==== Example
|
|
277
|
+
# data = {
|
|
278
|
+
# contacts: %w[email_1@example.com email_2@example.com email_3@example.com],
|
|
279
|
+
# templateId: 2,
|
|
280
|
+
# redirectUrl: "",
|
|
281
|
+
# lifeTime: 1440,
|
|
282
|
+
# maxVisits: 3
|
|
283
|
+
# }
|
|
284
|
+
# @data = @mints_user.send_magic_links(data)
|
|
285
|
+
def send_magic_links(data)
|
|
286
|
+
@client.raw('post', '/crm/contacts/send-magic-link', nil, data_transform(data))
|
|
287
|
+
end
|
|
292
288
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
289
|
+
##
|
|
290
|
+
# == Contacts Bulk Actions
|
|
291
|
+
#
|
|
296
292
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
#
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
end
|
|
293
|
+
##
|
|
294
|
+
# === Delete contacts.
|
|
295
|
+
# Delete different contacts.
|
|
296
|
+
#
|
|
297
|
+
# ==== Parameters
|
|
298
|
+
# data:: (Hash) -- Data to be submitted.
|
|
299
|
+
#
|
|
300
|
+
# ==== Example
|
|
301
|
+
# data = { ids": %w[67 68 69] }
|
|
302
|
+
# @data = @mints_user.delete_contacts(data)
|
|
303
|
+
def delete_contacts(data)
|
|
304
|
+
# TODO: ContactController.delete need a success output
|
|
305
|
+
@client.raw('delete', '/crm/contacts/delete', nil, data_transform(data))
|
|
306
|
+
end
|
|
307
|
+
end
|
data/lib/user/crm/crm.rb
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require_relative './
|
|
4
|
-
require_relative './
|
|
5
|
-
require_relative './
|
|
6
|
-
require_relative './
|
|
7
|
-
require_relative './
|
|
8
|
-
require_relative './
|
|
9
|
-
require_relative './
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative './companies'
|
|
4
|
+
require_relative './contacts'
|
|
5
|
+
require_relative './deals'
|
|
6
|
+
require_relative './favorites'
|
|
7
|
+
require_relative './segments'
|
|
8
|
+
require_relative './users'
|
|
9
|
+
require_relative './workflow_step_objects'
|
|
10
|
+
require_relative './workflow_steps'
|
|
11
|
+
require_relative './workflows'
|
|
10
12
|
|
|
11
13
|
module CRM
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
end
|
|
14
|
+
include Companies
|
|
15
|
+
include Contacts
|
|
16
|
+
include Deals
|
|
17
|
+
include Favorites
|
|
18
|
+
include Segments
|
|
19
|
+
include Users
|
|
20
|
+
include WorkflowStepObjects
|
|
21
|
+
include WorkFlowSteps
|
|
22
|
+
include Workflows
|
|
23
|
+
end
|