I have a python script which generates some HTML code to send via email. Within the script there is a variable (tweet), that I would like to include the content in the email.
Here is the code that generates the HTML for the email:
msg.add_alternative("""\
<!DOCTYPE html>
<html>
<body>
<p>Hi Human,</p>
<p>If you are seeing this, it means that you have received my email. Check out these images!</p>
<p>Best,</p>
<p>Simon</p>
<img src="cid:image1" ><br>
</body>
</html>
""", subtype='html')
I would like to add the variable 'tweet' into the body of the HTML code but don't know how to break the HTML and insert the variable and continue the HTML to finish.
Can someone help please?