fixed notification logic bug finally
uncommented email send