add Emails functionality in Rails and serialization