def get_email(recipients, sender='', msg='', subject='[No Subject]',
	text_content = None, footer=None, print_html=None, formatted=None, attachments=None,
	content=None, reply_to=None, cc=(), email_account=None):
	content = content or msg
	emailobj = EMail(sender, recipients, subject, reply_to=reply_to, cc=cc, email_account=email_account)

	if not content.strip().startswith("<"):
		content = markdown(content)

	emailobj.set_html(content, text_content, footer=footer, print_html=print_html, formatted=formatted)

	if isinstance(attachments, dict):
		attachments = [attachments]

	for attach in (attachments or []):
		emailobj.add_attachment(**attach)

	return emailobj
Convert Home Assistant brightness units to percentage.
dataset/ETHPy150Open frappe/frappe/frappe/email/email_body.py/get_email--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/light/limitlessled.py/_from_hass_brightness