Merge pull request #6473 from adityahase/email-queue-traceback

fix(email-queue): Record raised exception and traceback in Error Log
This commit is contained in:
Ameya Shenoy 2018-11-15 16:57:33 +05:30 committed by GitHub
commit 6a6f2c2adb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -206,8 +206,9 @@ def get_email_queue(recipients, sender, subject, **kwargs):
except frappe.InvalidEmailAddressError:
# bad Email Address - don't add to queue
frappe.log_error('Invalid Email ID Sender: {0}, Recipients: {1}'.format(mail.sender,
', '.join(mail.recipients)), 'Email Not Sent')
import traceback
frappe.log_error('Invalid Email ID Sender: {0}, Recipients: {1}, \nTraceback: {2} '.format(mail.sender,
', '.join(mail.recipients), traceback.format_exc()), 'Email Not Sent')
recipients = list(set(recipients + kwargs.get('cc', []) + kwargs.get('bcc', [])))
e.set_recipients(recipients)