Permalink
Browse files

index: style

  • Loading branch information...
rauchg committed Feb 12, 2013
1 parent 4db368b commit 74ec34cc741bc22892407b056475cd20e4164eef
Showing with 13 additions and 12 deletions.
  1. +13 −12 index.js
View
@@ -77,19 +77,20 @@ function create(key){
function send(key, message, fn){
debug('sending message %j with api key "%s"', message, key);
+ var url = 'https://mandrillapp.com/api/1.0/messages/send.json';
exports.request
- .post('https://mandrillapp.com/api/1.0/messages/send.json')
- .send({ key: key, message: message })
- .end(function(err, res){
- if (err) return fn(err);
- if (res.ok) {
- fn(null, res.body.return);
- } else {
- var err = new Error('Mandrill response status ' + res.status);
- err.data = res.body;
- fn(err);
- }
- });
+ .post(url)
+ .send({ key: key, message: message })
+ .end(function(err, res){
+ if (err) return fn(err);
+ if (res.ok) {
+ fn(null, res.body.return);
+ } else {
+ var err = new Error('Mandrill response status ' + res.status);
+ err.data = res.body;
+ fn(err);
+ }
+ });
}
/**

0 comments on commit 74ec34c

Please sign in to comment.