Reputation: 701
I always get error saying:
TypeError: Cannot call method 'config' of undefined.
This is my startup function on server.js
. What do I do wrong?
Meteor.startup(function() {
return Meteor.Mandrill.config({
username: "SMTP Username",
key: "Valid API Key",
password: "Valid API Key",
port: "587",
host:"smtp.mandrillapp.com"
});
});
Upvotes: 0
Views: 95
Reputation: 2870
The meteor startup function is not designed to return something, this is your first error.
On an other hand, I can see on their documentation that you have to configure the object Mandrill directly.
if (Meteor.isServer) {
// server code
Mandrill.config({
username: "SMTP Username",
key: "Valid API Key",
password: "Valid API Key",
port: "587",
host:"smtp.mandrillapp.com"
// baseUrl: 'https://mandrillapp.com/api/1.0/' // update this in case Mandrill changes its API endpoint URL or version
});
// you can put a Meteor startup here if you want :
Meteor.startup(function() {
// Do somthing else, like populating, ...
});
}
Upvotes: 1