How to add a python variable in html text (email)

If you are in a Python 3 runtime (you probably are), then the “f” string should work perfectly fine.

my_value=5 
html=f"<h1>My value is {my_value}</h1>"
1 Like