Single page javascript application for email generation