发送网格 - 当我使用 API 发送电子邮件时,我收到的电子邮件缺少所有设计,例如仅显示文本

Send Grid - When I send an email using the api, the email I receive is missing all the design e.g. just shows the text

本文关键字:电子邮件 显示 文本 网格 API      更新时间:2023-09-26

发送网格 - 当我使用 API 发送电子邮件时,我收到的电子邮件缺少所有设计,例如只显示文本。

我正在使用带有javascript的node js应用程序。

我让这一切都与 API 一起工作。

我只需要调用模板来包含图像。

是否有某种发送网格设置?

这是我使用的交易电子邮件。我调用 ID,如下面的代码示例所示。

它调用模板很好,只是不包括图像,只包含文本。

文档中的示例:

var email = new sendgrid.Email();
email.addTo('example@domain.com');
email.subject = "Send with templates app";
email.from = 'from@example.com';
email.text = 'Hi there!';
email.html = '<h1>Hi there!</h1>';
// add filter settings one at a time
email.addFilter('templates', 'enable', 1);
email.addFilter('templates', 'template_id', '09c6ab89-9157-4710-8ca4-db7927c631d6');

链接到文档:https://github.com/sendgrid/sendgrid-nodejs

有什么想法吗?

提前谢谢。

不要设置 email.text,看看是否能修复它。

我把email.text换成了email.html这似乎有效。

它必须需要一些 html 标记才能工作