def _lichess_message(league, username, subject, text): if league.enable_notifications: try: lichessapi.send_mail(username, subject, text) except lichessapi.ApiClientError as e: reason = str(e) if "The message was rejected" in reason: return raise
def notify_slack_link(self, lichess_username): player = Player.get_or_create(lichess_username) email = slackapi.get_user(player.slack_user_id).email msg = 'Your lichess account has been successfully linked with the Slack account "%s".' % email lichessapi.send_mail(lichess_username, 'Slack Account Linked', msg)
def _lichess_message(league, username, subject, text): if league.enable_notifications: lichessapi.send_mail(username, subject, text)