'Send report as an email'

def submit_report(self, dataset, job, tool, **kwargs):

    try:
        error_reporter = EmailErrorReporter(dataset.id, self.app)
        error_reporter.send_report(user=job.get_user(), email=kwargs.get('email', None), message=kwargs.get('message', None))
        return ('Your    error    report    has    been    sent', 'success')
    except Exception as e:
        return (('An    error    occurred    sending    the    report    by    email:    %s' % str(e)), 'danger')
