首页 > 解决方案 > 有什么方法可以在 Python 中使用 Sendgrid 向具有多个内容的多个收件人发送邮件?

问题描述

例如,如果有一个100 userswhere20 users paid their bills和剩余60 users don't pay their bills和剩余的列表20 users cancelled their order

在这种情况下,前 20 位应收到类似“注册成功”的邮件,其他 60 位用户应收到“请完成付款以继续”,其余 20 位用户应收到“您已成功取消”。

我知道我们可以在一个电话中发送多个收件人。如下所示

message = Mail(
    from_email='sender@example.com',
    to_emails=[To('test@example.com'), To('test2@example.com')],
    subject='Subject line',
    text_content='This is the message of your email',
)

但是,有没有办法发送多个内容的多个收件人呢?

标签: pythonpython-3.xemailsendgridsendgrid-templates

解决方案


推荐阅读