fix imports and other issues with email alerts