shz/node-mailgun — pull request #9 by tlhunter (2014-02-22 20:18:07+00:00)
Title: Chaning sendRaw() and sendText() argument parsing

If someone were to pass `''` as a servername, none of the other arguments would get parsed.
This change allows the latter arguments to get parsed.

For example, with the following code, the config object never gets loaded and the callback never runs:

var mailgun = new (require('mailgun').Mailgun)(config.mailgun);

mailgun.sendText("me@thomashunter.name", ["tlhunter@gmail.com"], "subj", "dat body", '', {}, function(err) {
log.info('mail send callback');
});

This code not running seems to violate the example in the readme, wherein servername is shown as defaulting to an empty string:

sendText(sender, recipients, subject, text, [servername=''], [options={}], [callback(err)])