Added the logic to handle sending emails, emails not actually sent yet.
typos and grammar
fixed missing piping symbol