Implementing email notification functionality