filename = os.path.join(LOGHOME, 'coaches-helpdesk.log') logging.basicConfig(filename=filename, format='%(asctime)s|%(levelname)s:%(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=numeric_level) desk = CoachesHelpDesk() emailer = Emailer(log_level=DEBUG) deliver = True messages = desk.open() emailer.send(messages, deliver=deliver) logging.info('Coaches Help desk: Open {} reminders sent'.format(len(messages))) items0 = getTextMessagesReport(messages) messages = desk.inProgress() emailer.send(messages, deliver=deliver) logging.info('Coaches Help desk: In Progress {} reminders sent'.format(len(messages))) items1 = getTextMessagesReport(messages) messages = desk.answered() emailer.send(messages, deliver=deliver) logging.info('Coaches Help desk: Answered {} reminders sent'.format(len(messages))) items2 = getTextMessagesReport(messages) messages = desk.impeded() emailer.send(messages, deliver=deliver) logging.info('Coaches Help desk: Impeded {} reminders sent'.format(len(messages))) items3 = getTextMessagesReport(messages)
filename = os.path.join(LOGHOME, 'delivery-board.log') logging.basicConfig(filename=filename, format='%(asctime)s|%(levelname)s:%(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=numeric_level) deliver = True desk = DeliveryBoard() emailer = Emailer(log_level=DEBUG) messages = desk.upcoming() emailer.send(messages, deliver=deliver) logging.info('Delivery Board: Upcoming {} reminders sent'.format( len(messages))) items = getTextMessagesReport(messages) message = """ Dear Reminders Admin, Please, have a summary of reminders sent for Upcoming Deliverables: Impeded issues """ + items + """ Kind regards, Fernando """ emailer.send_adm_msg(subject='Report for Delivery Board', intext=message, deliver=deliver)