Vaibhav,
Put this logic in UDF, when mapping root node. Add Error message in alert configuration. Alert email will contain correct error message.
if (Records!=Record_Count){ throw new RuntimeException("Number of records doesn't matches with the RECORD_COUNT." + "Number of Records in input is"+ Records +"But RECORD_COUNT is " + Record_Count); }Another option,
Trigger email from UDF. Link.