timmyg / meteor-mandrill

Meteor package for sending email via Mandrill
18 stars 19 forks source link

SMTP: Accounts settings must go before return Meteor.Mandrill.config #16

Closed adrawerofthings closed 10 years ago

adrawerofthings commented 10 years ago

This could simply be a Readme fix, but I found that the instance I deployed on Modulus.io only worked IF Accounts.config... and Accounts.emailTemplates... were written before return Meteor.Mandrill.config.... All of these were inside a server-side only Meteor.startup(function()...

So my code looks like this:

// in server code Meteor.startup(function() {

Accounts.config({sendVerificationEmail: true, forbidClientAccountCreation: false});

Accounts.emailTemplates.siteName = "sitename"; Accounts.emailTemplates.from = "Name support@sitename.com";

return Meteor.Mandrill.config({ username: "username", key: "password" });

});

andrewdhazlett commented 10 years ago

The return statement ends the execution of the function. It is also not required when calling Meteor.Mandrill.config. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return

adrawerofthings commented 10 years ago

Ah! Silly error on my part. Thanks for the catch!