I am going to build a virtual mail system for school. Teacher can use this system to send mail to teacher via web, and student can also check the mail via my web site. The content of email maybe either text or attached file. Teacher can set the delivery date and edit later. Teacher can also select sending to individual stutdent, all student in a class, or even all students in school. (Can be editted by teacher before delivery date). I have think about the below structure. I tried to write in PHP, but find out a bit hard to build up. I would like to hear some critize or comments with this design:
outgoing_mail table
no | from_user_id | subject | create_date | delivery_date | content_type
mail table
no | outgoing_mail_no | to_user_id | read_flag | delete_flag
mail_user_id table
no | student_no | teacher_no
mail_text
outgoing_mail_no | text
mail_attachment table
outgoing_mail_no | attachment_no
I find very difficult to write the editting part if the teacher want to change from "sending to whole class" to "sending to individual student" in a class.