forked from IntelliSOFT-Consulting/RapidPro-connector
-
Notifications
You must be signed in to change notification settings - Fork 1
/
connector.py
21 lines (18 loc) · 906 Bytes
/
connector.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Main connector file
import time
import schedule
from constants import KICKOFF_TYPE_ID, ENROLLMENT_TYPE_ID, APPOINTMENT_REMINDER_TYPE_ID, CONGRATULATE_GOAL_WEIGHT, CONGRATULATE_WELLNESS_JOURNEY, REMINDER_GOAL_WEIGHT
from SendMessage import SendMessage
from ConnectorUtils import ConnectorUtils
if __name__ == "__main__":
#SendMessage(ENROLLMENT_TYPE_ID).broadcast_message()
schedule.every(5).minutes.do(SendMessage(ENROLLMENT_TYPE_ID).broadcast_message)
schedule.every(5).minutes.do(SendMessage(KICKOFF_TYPE_ID).broadcast_message)
schedule.every(5).minutes.do(SendMessage(APPOINTMENT_REMINDER_TYPE_ID).broadcast_message)
while True:
schedule.run_pending()
time.sleep(1)
#create_contact()
print ConnectorUtils().get_last_checked(ENROLLMENT_TYPE_ID)
#SendMessage(ENROLLMENT_TYPE_ID).broadcast_message()
#SendMessage(KICKOFF_TYPE_ID).broadcast_message()