load email via js refactor