Mandrill 嵌入图像无法正确解释

Mandrill embed image cannot get interpreted properly

我在 Nodejs 中使用 Mandrill 向客户发送电子邮件,并希望在我的 html 内容中嵌入图像作为电子邮件的附件。我从 https://mandrill.zendesk.com/hc/en-us/articles/205582457-Tips-for-using-images-in-Mandrill-emails 中找到了一些解决方案,并决定使用第 4 个,其中包括 html 中的内联图像。代码如下:

var message = {
  html: htmlContent,
  subject: "Subject",
  ...
  images = [{
    "type": logo.logoType, // which is "image/jpeg"
    "name": "logo",
    "content": content // the content is valid when using in <img src="data:image/jpeg;base64,content"> directly
  }]
};
mandrillClient.messages.send({
  message: message
}, function() {
  callback(null);
}, function(err) {
  callback(err);
})

htmlContent中对应的html代码为

<img src="cid:logo">

但是,当我在 Mandrill Outbound Activity 中检查已发送的电子邮件时,"View Content" 没有正确显示图像。我查看了 html 源代码,发现图像代码仍然是

<img src="cid:logo">

纯文本没有被图像数据替换。

如何让它正常工作?有什么想法吗?

提前致谢。

最后我发现它在 Mandrill Outbound Activity 中检查已发送的电子邮件时不起作用,但它在您的实际电子邮件收件箱中工作正常。所以这意味着您在进行测试时永远不会看到嵌入的图像,您必须使用生产密钥 api 发送它并在真实的电子邮件收件箱中查看结果。

仅供参考。希望没有人会像我一样在这上面浪费时间。 :)