implemented email invoice functionality