Automate the status change of inbound emails

By default, the "Email Status" of Inbound emails are set to "Unread". I'm hoping to get some ideas on how we can automate the status change when the following actions are taken:

  • Change the status to "Read" when the assigned user goes to the detail view of the inbound email.
  • Change the status to "Replied" when the assigned user sends a reply.