added feature for sending a mail when a document is approved/denied, and...

... fixed a bug dealing with updating documents