You can also create an email device that looks something like this:
var _fakeInboxCollection = new Package['mongo'].Mongo.Collection('Emails'); Meteor.startup(function () { _clearState(); _initFakeInbox(); }); Meteor.methods({ 'clearState': _clearState, 'getEmailsFromInboxStub': function () { return _fakeInboxCollection.find().fetch() } }); function _initFakeInbox () { _fakeInboxCollection.remove({}); Email.send = function (options) { _fakeInboxCollection.insert(options); }; } function _clearState () { _fakeInboxCollection.remove({}); }
This will allow you to send emails normally, as well as clear / receive emails using DDP.
source share