好吧,我更新了我的代码,现在它看起来像这样如何通过一个变量在一封电子邮件,流星
import { meteorhacksssr } from 'meteor/meteorhacks:ssr';
SSR.compileTemplate('InviteEmail', Assets.getText('InviteEmail.html'));
var emailData = {
name: "tom"
};
Meteor.methods({
addInvite(code) {
Invites.insert({
code : code,
sentTo: '[email protected]',
accepted: false
});
var emailData = {
code: code
};
Email.send({
to: "[email protected]",
from: "[email protected]",
subject: "Example Email",
text: SSR.render('InviteEmail', emailData),
});
}
});
这里是名为InviteEmail.html
<template name="InviteEmail">
<html>
<body>
hi {{code}}
</body>
</html>
</template>
服务器文件夹,我的HTML模板
但现在我的应用程序崩溃CMD说:Error: Unknown asset: InviteEmail.html
我安装的包,现在进口它,我必须解决它
感谢每一个帮助;)
@Sean也许你可以帮我 – Michael
@Zim也许你可以帮我 – Michael