replace email notify function