Changed the email service to use an entity object is one is passed to
it.