TypeError: get_email() got an unexpected keyword argument 'formatted' in Send Mail

In send mail I am getting this error.

Traceback (most recent call last):
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 102, in execute_job
method(**kwargs)
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 500, in sendmail
recipients=recipients, cc=cc, bcc=bcc)
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 209, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc, bcc)
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 173, in _notify
print_letterhead=frappe.flags.print_letterhead
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/init.py”, line 489, in sendmail
inline_images=inline_images, header=header, print_letterhead=print_letterhead)
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/email/queue.py”, line 161, in send
print_letterhead=print_letterhead)
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/email/queue.py”, line 182, in add
email_queue = get_email_queue(recipients, sender, subject, **kwargs)
File “/home/ubuntu/erpnext/frappe-bench/apps/frappe/frappe/email/queue.py”, line 217, in get_email_queue
header=kwargs.get(‘header’))
TypeError: get_email() got an unexpected keyword argument ‘formatted’

can anyone suggest how to resolve this ?

ERPNext Version 12
Frappe Version 12