diff --git a/lazylibrarian/notifiers/email_notify.py b/lazylibrarian/notifiers/email_notify.py index 3d1395d71..d60d12ba4 100644 --- a/lazylibrarian/notifiers/email_notify.py +++ b/lazylibrarian/notifiers/email_notify.py @@ -40,12 +40,6 @@ def _notify(message, event, force=False, files=None): subject = event text = message - logger.debug('Email notification: %s' % message['Subject']) - logger.debug('Email from: %s' % message['From']) - logger.debug('Email to: %s' % message['To']) - logger.debug('Email text: %s' % text) - logger.debug('Files: %s' % files) - if files: message = MIMEMultipart() message.attach(MIMEText(text)) @@ -57,6 +51,12 @@ def _notify(message, event, force=False, files=None): message['To'] = lazylibrarian.CONFIG['EMAIL_TO'] message['Date'] = formatdate(localtime=True) + logger.debug('Email notification: %s' % message['Subject']) + logger.debug('Email from: %s' % message['From']) + logger.debug('Email to: %s' % message['To']) + logger.debug('Email text: %s' % text) + logger.debug('Files: %s' % files) + if files: for f in files: if os.path.getsize(f) > 20000000: