formatting emails json representation