Update the environment
Add a condition
Fix the mail sending
Merge pull request #3 from jarmokortetjarvi/master

Hopefully fix the mail sending issue