Added status.txt and email sent checking

added status file and logic to check whether an email has already been sent for this threshold.