在SendGrids上使用USE案例之后,github确实设法向我发送了带有正确模板的电子邮件,但是替换显然不起作用,并且在生成的电子邮件中留为空白。服务器端:
const sgmailer = require("@sendgrid/mail");
sgmailer.setApiKey(process.env.SENDGRID_API_KEY);
sgmailer.setSubstitutionWrappers('{{', '}}');
const msg = {
to: '...',
from: 'sender@example.org',
subject: 'Hello world',
text: 'Hello plain world!',
html: '<p>Hello HTML world!</p>',
templateId: '...',
substitutions: {
name: 'Some One',
city: 'Denver',
},
};
sgmailer.send(msg)
Run Code Online (Sandbox Code Playgroud)
模板中的HTML:
const sgmailer = require("@sendgrid/mail");
sgmailer.setApiKey(process.env.SENDGRID_API_KEY);
sgmailer.setSubstitutionWrappers('{{', '}}');
const msg = {
to: '...',
from: 'sender@example.org',
subject: 'Hello world',
text: 'Hello plain world!',
html: '<p>Hello HTML world!</p>',
templateId: '...',
substitutions: {
name: 'Some One',
city: 'Denver',
},
};
sgmailer.send(msg) …Run Code Online (Sandbox Code Playgroud)React-select找不到React:TypeError:React is undefined1 react-select.js:826:4
React-select.js正在做出反应
var React = (window.React);
Run Code Online (Sandbox Code Playgroud)
看起来我必须在html中包含React以使其工作,但我想避免这种情况.有什么我想念的吗?
(使用节点)