Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -237,19 +237,9 @@ def handle_incoming_request():
|
|
237 |
response_2 = send_request(560832, email, phone, name, 393196, 393195, pr5, pr4, pr3, pr2, pr1, 393267, 393266, 393265, 393264, 393263)
|
238 |
response_3 = send_request(560833, email, phone, name, 393198, 393197, pr5, pr4, pr3, pr2, pr1, 393272, 393271, 393270, 393269, 393268)
|
239 |
# Возвращаем список ответов
|
240 |
-
return {'responses': [response_1,response_2,response_3]}
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
|
|
|
253 |
elif current_day == 1: # Вторник
|
254 |
if current_hour < 19:
|
255 |
# Утром во вторник
|
@@ -259,106 +249,15 @@ def handle_incoming_request():
|
|
259 |
response_3 = send_request(560833, email, phone, name, 393198, 393197, pr5, pr4, pr3, pr2, pr1, 393272, 393271, 393270, 393269, 393268)
|
260 |
# Возвращаем список ответов
|
261 |
return {'responses': [response_1,response_2,response_3]}
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
else:
|
267 |
# Вечером во вторник
|
268 |
-
# Комментарий: Отправка
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
phone = request.args.get('phone')
|
274 |
-
data = {
|
275 |
-
"email": email,
|
276 |
-
"unconfirmed": False,
|
277 |
-
"values": [
|
278 |
-
{
|
279 |
-
"parameter_id": 393120,
|
280 |
-
"kind": "string",
|
281 |
-
"list_id": 560771,
|
282 |
-
"title": "phone",
|
283 |
-
"value": phone
|
284 |
-
},
|
285 |
-
{
|
286 |
-
"parameter_id": 393119,
|
287 |
-
"kind": "string",
|
288 |
-
"list_id": 560771,
|
289 |
-
"title": "name",
|
290 |
-
"value": name
|
291 |
-
}
|
292 |
-
]
|
293 |
-
}
|
294 |
-
headers = {
|
295 |
-
'Authorization': f'Bearer {token}',
|
296 |
-
'Content-Type': 'application/json'
|
297 |
-
}
|
298 |
-
response = requests.post(f"{base_url}/email/lists/560771/recipients", json=data, headers=headers)
|
299 |
-
|
300 |
-
show_params = False
|
301 |
-
list_id = 560772
|
302 |
-
name = request.args.get('name')
|
303 |
-
email = request.args.get('email')
|
304 |
-
phone = request.args.get('phone')
|
305 |
-
data = {
|
306 |
-
"email": email,
|
307 |
-
"unconfirmed": False,
|
308 |
-
"values": [
|
309 |
-
{
|
310 |
-
"parameter_id": 393120,
|
311 |
-
"kind": "string",
|
312 |
-
"list_id": 560772,
|
313 |
-
"title": "phone",
|
314 |
-
"value": phone
|
315 |
-
},
|
316 |
-
{
|
317 |
-
"parameter_id": 393119,
|
318 |
-
"kind": "string",
|
319 |
-
"list_id": 560772,
|
320 |
-
"title": "name",
|
321 |
-
"value": name
|
322 |
-
}
|
323 |
-
]
|
324 |
-
}
|
325 |
-
headers = {
|
326 |
-
'Authorization': f'Bearer {token}',
|
327 |
-
'Content-Type': 'application/json'
|
328 |
-
}
|
329 |
-
response = requests.post(f"{base_url}/email/lists/560772/recipients", json=data, headers=headers)
|
330 |
-
|
331 |
-
show_params = False
|
332 |
-
list_id = 560773
|
333 |
-
name = request.args.get('name')
|
334 |
-
email = request.args.get('email')
|
335 |
-
phone = request.args.get('phone')
|
336 |
-
data = {
|
337 |
-
"email": email,
|
338 |
-
"unconfirmed": False,
|
339 |
-
"values": [
|
340 |
-
{
|
341 |
-
"parameter_id": 393120,
|
342 |
-
"kind": "string",
|
343 |
-
"list_id": 560773,
|
344 |
-
"title": "phone",
|
345 |
-
"value": phone
|
346 |
-
},
|
347 |
-
{
|
348 |
-
"parameter_id": 393119,
|
349 |
-
"kind": "string",
|
350 |
-
"list_id": 560773,
|
351 |
-
"title": "name",
|
352 |
-
"value": name
|
353 |
-
}
|
354 |
-
]
|
355 |
-
}
|
356 |
-
headers = {
|
357 |
-
'Authorization': f'Bearer {token}',
|
358 |
-
'Content-Type': 'application/json'
|
359 |
-
}
|
360 |
-
response = requests.post(f"{base_url}/email/lists/560773/recipients", json=data, headers=headers)
|
361 |
|
|
|
362 |
elif current_day == 2: # Среда
|
363 |
if current_hour < 19:
|
364 |
# Утром в среду
|
|
|
237 |
response_2 = send_request(560832, email, phone, name, 393196, 393195, pr5, pr4, pr3, pr2, pr1, 393267, 393266, 393265, 393264, 393263)
|
238 |
response_3 = send_request(560833, email, phone, name, 393198, 393197, pr5, pr4, pr3, pr2, pr1, 393272, 393271, 393270, 393269, 393268)
|
239 |
# Возвращаем список ответов
|
240 |
+
return {'responses': [response_1,response_2,response_3]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
+
|
243 |
elif current_day == 1: # Вторник
|
244 |
if current_hour < 19:
|
245 |
# Утром во вторник
|
|
|
249 |
response_3 = send_request(560833, email, phone, name, 393198, 393197, pr5, pr4, pr3, pr2, pr1, 393272, 393271, 393270, 393269, 393268)
|
250 |
# Возвращаем список ответов
|
251 |
return {'responses': [response_1,response_2,response_3]}
|
|
|
|
|
|
|
|
|
252 |
else:
|
253 |
# Вечером во вторник
|
254 |
+
# Комментарий: Отправка только лист 2, лист 3
|
255 |
+
response_2 = send_request(560832, email, phone, name, 393196, 393195, pr5, pr4, pr3, pr2, pr1, 393267, 393266, 393265, 393264, 393263)
|
256 |
+
response_3 = send_request(560833, email, phone, name, 393198, 393197, pr5, pr4, pr3, pr2, pr1, 393272, 393271, 393270, 393269, 393268)
|
257 |
+
# Возвращаем список ответов
|
258 |
+
return {'responses': [response_2,response_3]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
|
260 |
+
|
261 |
elif current_day == 2: # Среда
|
262 |
if current_hour < 19:
|
263 |
# Утром в среду
|