我设置了以下Meteor方法:
// Defined in collections/collections.js
Meteor.methods({
email: function(options) {
this.unblock();
Email.send(options);
}
});
我称之为:
// Defined in client/main.js
Meteor.call('email', {
to: 'yeahright@noneya.com', from: 'yeahright@noneya.com',
text: 'testing testing'
});
我收到两个错误,一个在浏览器控制台中:
Exception while simulating the effect of invoking 'email'
ReferenceError {stack: "ReferenceError: Email is not defined↵ at Meteor…js?acc2397bd1f7321a583a30e0d4628ec4f9fded4b:369:3", message: "Email is not defined"}
ReferenceError: Email is not defined
(etc....)
运行meteor
的服务器shell中的另一个:
Exception while invoking method 'email' ReferenceError: Email is not defined
(etc....)
发生了什么事?我觉得我完全遵循了documentation's instructions,而且我没有像this one或this one这样的问题做任何类似的错误。
答案 0 :(得分:6)
您是否添加了电子邮件包?
meteor add email
答案 1 :(得分:5)