首页 > 解决方案 > 在 HTML 电子邮件中以列表形式呈现所有内容

问题描述

我到处搜索,但找不到解决方案。如何将列表插入 HTML 电子邮件?

mylist = [1, 2, 3, 4] # Can be longer and contain numbers and letters

# I have reduced my HTML Email code

html = """\
    {% for i in mylist%}
        <tr>
          <td> {{ i }} </td>
        </tr>
    {& endfor &}
""".format(mylist)

我已经尝试过了,但效果不佳。

我感谢您的帮助。提前致谢

标签: python

解决方案


{% endfor %}而不是{& endfor &}


推荐阅读