Converted view.js to mail.js using InboxObject super class