To send the subject wise messages, follow below path to create the subject group, based the selected subject, group will be created on the subject name automatically
Communication --> Communication --> New Student wall (Chat) --> Click on Class --> Send Message --> Update the fields --> Send message