- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试发送一封带有 node-sparkpost
附件的电子邮件(它在后台使用 transmissions API)。
为什么以下代码发送了电子邮件,但没有附件?
"use strict";
let Sparkpost = require("sparkpost");
let apiKey = "xxx";
let fromAddress = "dan@example.com";
let toAddress = "dare@example.com";
let spClient = new Sparkpost(apiKey);
spClient.transmissions
.send({
options: {},
content: {
from: fromAddress,
subject: "The subject",
html: "See attached file.",
text: "See attached file."
},
recipients: [{ address: toAddress }],
attachments: [
{
name: "attachment.json",
type: "application/json",
data: Buffer.from("{}").toString("base64")
}
]
})
.then(data => {
console.log("email mail sent");
console.log(data);
})
.catch(err => {
console.log("email NOT sent");
console.log(err);
});
最佳答案
一个经典的 self 橡皮回避时刻。
attachments
属性必须是 content
的子属性:
content: {
from: fromAddress,
subject: "The subject",
html: "See attached file.",
text: "See attached file.",
attachments: [
{
name: "attachment.json",
type: "application/json",
data: Buffer.from("{}").toString("base64")
}
]
},
关于javascript - node-sparkpost 不包括电子邮件中的附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54592748/
我正在尝试使用 Html 标签来发送电子邮件,就像设计模板一样,我该怎么做。 使用sparkLibrary的sendEmail方法我只能发送文本格式的电子邮件,我如何设计电子邮件模板并发送它。 Sp
所以,我有一个 http 端点,用于从 SparkPost 接收不同类型的事件(例如交付、退回、投诉、打开跟踪等)。一切正常,但我没有收到有关 Click 事件的任何帖子。到目前为止,这是我尝试过的:
我正在尝试发送一封带有 node-sparkpost 附件的电子邮件(它在后台使用 transmissions API)。 为什么以下代码发送了电子邮件,但没有附件? "use strict"; le
我对时事通讯中的取消订阅链接有疑问,无法弄清楚我做错了什么。 时事通讯中的链接是Unsubscribe" . 我创建了一个具有相同目标 URL 的网络钩子(Hook),它似乎被触发了,因为它说“哦,是
这是我第一次在 Rails 项目中设置邮件。 我被告知要使用 SparkPost 并为多种操作为不同的语言创建模板。 为简单起见,我们假设一个 user_signed_up(user) 邮件。 目前我
我正在使用 Sparkpost java 客户端库。 当我将 fromEmail 和 username 设置为 contentAttributes 时,我希望在我的电子邮件中看到 Name Name
我正在使用这个 guide作为为我的 Rails 应用程序设置 ActionMailer 的引用,但每当我尝试发送邮件时都会收到此错误。我也尝试使用与指南完全相同的设置进行复制,但我仍然遇到相同的错误
我使用 SparkPost 发送电子邮件,但我发送的电子邮件变成了垃圾邮件。我使用的发送电子邮件是: sandbox@sparkpostbox.com 也许正是因为这个原因,该电子邮件才成为垃圾邮件。
我正在 cakephp 2.2.3 中开发一个 Web 应用程序。我使用的那个应用程序是 CakeEmail。但现在我想实现 SparkPost 插件来发送电子邮件。 我在谷歌上花了很多时间,但没有得
我在使用 SparkPost 发送电子邮件时遇到问题:我的代码如下: from configurations.global_configs import site_base_url from medi
我正在根据模板使用 Java API TransmissionWithRecipientArray 对象发送电子邮件。我在替换数据方面遇到一些问题。我已在模板编辑器中测试了此数据,但我不知道如何使用
我成功地使用 Mandrill 从我的 CodeIgniter 站点发送邮件,配置如下: $config['mailtype'] = "html"; $config['protocol'] = 'sm
我使用 SparkPost 从我的 node.js 应用程序发送电子邮件。 但是,所有链接都会转换为 url,例如:http://go.sparkpostmail1.com/f/a/EgvUoS2Ld
我们正在努力将我们的电子邮件应用程序与 SparkPost 集成。我们唯一遇到的问题是收到来自 SparkPost 的退回电子邮件,以将它们从 future 的邮件中排除。我们的应用程序直接从邮件服务
我使用 SparkPost 作为我的发送邮件服务器。当该站点位于我的开发服务器中时,我已通过从 WHM 面板输入 DNS 来验证发送域。 现在我已在 Microsoft Azure 中部署了该网站。我
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 2 年前。 Improve
这是我的传输对象: if(req.body.bcc === ''){ req.body.bcc = ''; } if (req.body.cc === '') { req.
当我使用 SparkPost::Client.new().send_message(param1,参数 2 等...)。此处示例:https://github.com/SparkPost/ruby-s
我在 SparkPost 仪表板中创建了模板。但我面临的问题是我无法通过调用 api 来发送“CC”或“BCC”。下面的代码片段将帮助您理解我想要做什么。 var SPARKPOST_KEY = "K
我通过带有选项 sandbox=true 的 SparkPost API 发送消息。我收到错误消息“致命的 SparkPostError:超出发送限制” 我无法在 DOC、Google 或 stack
我是一名优秀的程序员,十分优秀!