def send_challenge_reminder(user_id):
    user = get_user_model().objects.get(id=user_id)
    today = datetime.date.today()
    filters = {'status': Challenge.ACTIVE, 'end_date': today}
    ending_challenges = user.challenges_recieved.filter(**filters)
    email_subject = _('Challenge ends today!')
    email_context = {'ending_challenges': ending_challenges}
    send_email([user.email], email_subject, 'challenges/emails/challenges_reminder.html', email_context)
def send_challenge_reminder(user_id):
    user = get_user_model().objects.get(id=user_id)
    today = datetime.date.today()
    filters = {'status': Challenge.ACTIVE, 'end_date': today}
    ending_challenges = user.challenges_recieved.filter(**filters)
    email_subject = _('Challenge ends today!')
    email_context = {'ending_challenges': ending_challenges}
    send_email([user.email], email_subject, 'challenges/emails/challenges_reminder.html', email_context)