https://github.com/edx/notifier/blob/master/notifier/digest.py#L47