Update EmailTemplate to support both json config and mongod db