The whole thing looks something like this :
def send_email(recipient, subject, html_content):
try:
# Replace image URLs in the HTML template so that they point to the content IDs
html_content = html_content.replace('src=“logo.png”', 'src=“cid:logo_img” alt=“company logo”')
html_content =...