私は文書を挿入する流星法を持っています。そのドキュメントのidはurl拡張子の役割を果たします。ドキュメントが作成された後、同じ方法で電子メールを送信します。電子メールでは、URL拡張子へのリンクを含めたいと思います。どうやってやるの?流星ドキュメントから流星:メソッド内で挿入された_idを取得するにはどうすればよいですか?
//create a video
Meteor.methods({
createVideo: function(doc) {
Videos.insert({title: doc.title, userId: this.userId, date: new Date()});
var emailData = {
message: "Click the link below to go to your video.",
buttontext: "View My Video",
buttonlink: "http://sample.com/vids/" + ???????
},
body = EmailGenerator.generateHtml("actionEmailTemplate", emailData);
Meteor.call("sendMailgunEmail",
"[email protected]",
"sample",
[Meteor.user().emails[0].address],
"Your video is live!",
body
);
}
});