Ejemplo n.º 1
0
def get_emails_enabled(user, course_id):
    """
    Get whether or not emails are enabled in the context of a course.

    Arguments:
        user: the user object for which we want to check whether emails are enabled
        course_id (string): the course id of the course

    Returns:
        (bool): True if emails are enabled for the course associated with course_id for the user;
        False otherwise
    """
    if is_bulk_email_feature_enabled(course_id=course_id):
        return not is_user_opted_out_for_course(user=user, course_id=course_id)
    return None
Ejemplo n.º 2
0
    def get_emails_enabled(user, course_id):
        """
        Get whether or not emails are enabled in the context of a course.

        Arguments:
            user: the user object for which we want to check whether emails are enabled
            course_id (string): the course id of the course

        Returns:
            (bool): True if emails are enabled for the course associated with course_id for the user;
            False otherwise
        """
        if is_bulk_email_feature_enabled(course_id=course_id):
            return not is_user_opted_out_for_course(user=user, course_id=course_id)
        else:
            return None