def notifyUsersActiveGames(): activeGames = Games.query(Games.active == True).fetch() # print activeGames for ag in activeGames: user = Users.get_by_id(ag.user_id) mail.send_mail( 'noreply@%s.appspotmail.com' % (app_identity.get_application_id()), # from user.email, # to 'Reminder', # subj 'Reminder: You have an active game! ' # body # 'gameInfo:\r\n\r\n%s' % ag. )