def todo_get(): logger.debug({ 'action': 'todo_get', }) todo = ToDo() data = todo.select_table() logger.debug({'action': 'todo_get', 'data': data}) return jsonify({'data': data}), 200
def todo_send_mail(): logger.debug({ 'action': 'send-mail', }) todo = ToDo() data = todo.select_table() config = configparser.ConfigParser() config.read('config.ini') username = config['EMAIL']['username'] password = config['EMAIL']['password'] logger.info({ 'action': 'todo_send_mail', 'username': username, 'password': password }) mailer = mail.Mailer(username, password) content = data mailer.send(recipient_address=username, content=content) return jsonify({'data': data}), 200