fix: Use email_account_doc to get track_email_status value
This commit is contained in:
parent
8e9432e40d
commit
925f1273d5
3 changed files with 7 additions and 2 deletions
|
|
@ -19,7 +19,8 @@
|
|||
"unreplied_for_mins": 20,
|
||||
"send_notification_to": "test_unreplied@example.com",
|
||||
"pop3_server": "pop.test.example.com",
|
||||
"no_remaining":"0"
|
||||
"no_remaining":"0",
|
||||
"track_email_status": 1
|
||||
},
|
||||
{
|
||||
"doctype": "ToDo",
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ class SendMailContext:
|
|||
'<img src="https://{}/api/method/frappe.core.doctype.communication.email.mark_email_as_seen?name={}"/>'
|
||||
|
||||
message = ''
|
||||
if frappe.conf.use_ssl and self.queue_doc.track_email_status:
|
||||
if frappe.conf.use_ssl and self.email_account_doc.track_email_status:
|
||||
message = quopri.encodestring(
|
||||
tracker_url_html.format(frappe.local.site, self.queue_doc.communication).encode()
|
||||
).decode()
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class TestEmail(unittest.TestCase):
|
|||
frappe.db.sql("""delete from `tabEmail Queue Recipient`""")
|
||||
|
||||
def test_email_queue(self, send_after=None):
|
||||
frappe.conf.use_ssl = True
|
||||
frappe.sendmail(recipients=['test@example.com', 'test1@example.com'],
|
||||
sender="admin@example.com",
|
||||
reference_doctype='User', reference_name='Administrator',
|
||||
|
|
@ -29,6 +30,9 @@ class TestEmail(unittest.TestCase):
|
|||
self.assertTrue('test1@example.com' in queue_recipients)
|
||||
self.assertEqual(len(queue_recipients), 2)
|
||||
self.assertTrue('<!--unsubscribe url-->' in email_queue[0]['message'])
|
||||
# check for email tracker
|
||||
self.assertTrue('frappe.core.doctype.communication.email.mark_email_as_seen' in email_queue[0]['message'])
|
||||
frappe.conf.use_ssl = False
|
||||
|
||||
def test_send_after(self):
|
||||
self.test_email_queue(send_after=1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue