Help with code frappe.attach_print

I have the below code to send Invoices and delivery notes to emails as PDF. It was working fine but now after recent update the PDF does not contain any letterhead.

def send_email_with_attachment(doctype, docname, recipients):
	attachments = [frappe.attach_print(doctype, docname)]
	if attachments and recipients:
		frappe.sendmail(recipients = recipients,
				cc = recipients,
				sender="", 
				subject=docname, 
				message="",
				delayed=False,
				attachments=attachments
		)

Found the solution

print_letterhead=True

def send_email_with_attachment(doctype, docname, recipients):
	attachments = [frappe.attach_print(doctype=doctype, name=docname, print_letterhead=True)]
	if attachments and recipients:
		frappe.sendmail(recipients = recipients,
				cc = recipients,
				sender="", 
				subject=docname, 
				message="",
				delayed=False,
				attachments=attachments
		)
1 Like