无法通过mandrillapp JSON api将文档附加到电子邮件中

时间:2015-11-05 09:04:21

标签: javascript json email mandrill

我正在尝试通过jravascript通过mandrillapp JSON api send-template方法发送带有附加文档的电子邮件,电子邮件已成功发送,甚至图像也可以附加到images数组,但文档是使用base64内容发送的attachements数组不会被传递。以下是请求的示例

url:https://mandrillapp.com/api/1.0/messages/send-template.json

POST数据:

"key":"private key",
"message": {
  attachements: [
     {content: "dGVzdA0K", name: "test.txt", type: "text/plain"}
  ],
  images: [
     {content: "iVBORw0KGgoAAAAN...", name: "img.png", type: "image/png"}
  ],
  ...
}
...

收到包含内容和图片的邮件但没有文本文件。我试图发送它失败了。

1 个答案:

答案 0 :(得分:1)

问题是由于有效载荷中“附件”一词中的拼写错误。它应该是附件。

希望这有帮助,

相关问题