add email notification functionality