123456789101112131415161718192021222324 |
- def send_reminders(all_targets):
- """Send reminders for unsent pictures because of internet outage."""
- mail_list = []
- msg = "There are unsent pictures on the Whiteboardbot SD-Card, \
- because of an Internet outage on the last trigger. \
- They are automatically going to get deleted in 30 days."
- for action, activated in all_targets.items():
- if activated:
- if action == 'slack':
- SlackBot.send_message(SlackBot, msg, attachment=None,
- channel=get_key("Slack", "channel_name"))
- else:
- mail_list.append(action)
- if len(mail_list) > 0:
- addresses = []
- print(mail_list)
- for mail_num in mail_list:
- addresses.append(get_key(mail_num, "address"))
- # TODO check if this handover worked correctly
- send_reminder(addresses, msg)
- return time()
|