【问题标题】:How to add CC recipient in Sendgrid v3?如何在 Sendgrid v3 中添加抄送收件人?
【发布时间】:2017-04-21 11:19:07
【问题描述】:

您好,我需要使用 PHP 中的 sendgrid v3 API 添加其他“cc”收件人。我该怎么做?

他们在文档中放了以下代码,但我觉得不够,因为我需要看看如何添加“抄送”收件人。

$request_body = json_decode('{
  "personalizations": [
{
  "to": [
    {
      "email": "test@example.com"
    }
  ],
  "subject": "Hello World from the SendGrid PHP Library!"
}
],
"from": {
"email": "test@example.com"
},
"content": [
{
  "type": "text/plain",
  "value": "Hello, Email!"
}
]
}'
);

【问题讨论】:

标签: php sendgrid cc


【解决方案1】:

在疯狂地尝试和搜索之后,我找到了答案:

$request_body = json_decode('{  "personalizations": [
{
  "to": [
    {
      "email": "mailto@domiain.com"
    }
  ],
  "cc":[
    {
        "email": "mailcc@domiain.com"
  }],
  "subject": "Hello world"
}  
],  
"from": {
"email": "robot@server.com"
},"content": [
{
  "type": "text/html",
  "value": "<strong>Hello</strong>, Email!"
}]}');

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-17
    • 2017-12-09
    • 1970-01-01
    • 2018-11-09
    • 2015-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多