有没有办法向联系人列表发送电子邮件?

发布于 2025-01-13 09:40:45 字数 43 浏览 0 评论 0原文

有没有办法向联系人列表发送电子邮件?我找不到任何关于此的 api 文档。

Is there anyway to send email to a list of contact? I can't find any api docs about this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁我热情 2025-01-20 09:40:45

使用 SendGrid 发送电子邮件时,您可以发送到一个或多个电子邮件地址,并且可以通过 tocc 和/或 bcc 执行此操作代码>字段。

当您通过 SendGrid 发送电子邮件时,您可以使用“个性化”来发送电子邮件。 根据文档,个性化设置为:

消息及其元数据的数组。个性化中的每个对象都可以被视为一个信封 - 它定义谁应该接收单独的消息以及应该如何处理该消息。

个性化数组的示例可能如下所示:

[
    {
      to: [
        {
          email: '[email protected]',
          name: 'John Doe'
        },
        {
          email: '[email protected]',
          name: 'Julia Doe'
        }
      ],
      cc: [
        {
          email: '[email protected]',
          name: 'Jane Doe'
        }
      ],
      bcc: [
        {
          email: '[email protected]',
          name: 'Jim Doe'
        }
      ]
    },
    {
      from: {
        email: '[email protected]',
        name: 'Example Sales Team'
      },
      to: [
        {
          email: '[email protected]',
          name: 'Janice Doe'
        }
      ],
      bcc: [
        {
          email: '[email protected]',
          name: 'Jordan Doe'
        }
      ]
    }
  ]

在上面的示例中,一封电子邮件发送给两个不同的人,John Doe 和 Julia Doe,抄送给 Jane Doe,密送给 Jim Doe。内容相同的电子邮件也会从不同的电子邮件地址发送 ([电子邮件受保护]< /a>) 发送给 Janice Doe,并密件抄送给 Jordan Doe。

希望您可以看到指定电子邮件收件人非常灵活,您可以同时发送给很多人。

查看使用 SendGrid 发送电子邮件的文档和代码示例了解更多信息。

When sending an email with SendGrid you can send to one or multiple email addresses, and you can do so via the to, cc, and/or bcc fields.

When you send an email via SendGrid, you do so using "personalizations". According to the documentation, personalizations are:

An array of messages and their metadata. Each object within personalizations can be thought of as an envelope - it defines who should receive an individual message and how that message should be handled.

An example of an array of personalizations might look like this:

[
    {
      to: [
        {
          email: '[email protected]',
          name: 'John Doe'
        },
        {
          email: '[email protected]',
          name: 'Julia Doe'
        }
      ],
      cc: [
        {
          email: '[email protected]',
          name: 'Jane Doe'
        }
      ],
      bcc: [
        {
          email: '[email protected]',
          name: 'Jim Doe'
        }
      ]
    },
    {
      from: {
        email: '[email protected]',
        name: 'Example Sales Team'
      },
      to: [
        {
          email: '[email protected]',
          name: 'Janice Doe'
        }
      ],
      bcc: [
        {
          email: '[email protected]',
          name: 'Jordan Doe'
        }
      ]
    }
  ]

In the above example, one email is sent to two different people, John Doe and Julia Doe, cc'd to Jane Doe and bcc'd to Jim Doe. An email with the same content is also sent from a different email address ([email protected]) to Janice Doe and bcc'd to Jordan Doe.

Hopefully you can see that specifying the recipients of an email is very flexible and you can send to many people at the same time.

Check out the documentation and code examples for sending emails with SendGrid for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文