Refactoring of exporter to make way for sending
First working email sending