Log sendgrid error (#62)

This commit is contained in:
William O'Beirne 2019-01-10 18:21:41 -05:00 committed by Daniel Ternyak
parent fbbd20ae90
commit b01b7726a7
1 changed files with 2 additions and 0 deletions

View File

@ -103,3 +103,5 @@ def send_email(to, type, email_args):
print('Just sent an email to %s of type %s, response code: %s' % (to, type, res.status_code))
except Exception as e:
print('An error occured while sending an email to %s - %s: %s' % (to, e.__class__.__name__, e))
if hasattr(e, 'body'):
print(e.body)