Feature/email scripts update

Based on richardreview so that one has to be merged first.