mailgun-js
Advanced tools
Comparing version 0.3.5 to 0.4.2
(The MIT License) | ||
Copyright (c) 2012 OneLobby <http://www.onelobby.com> | ||
Copyright (c) 2012 - 2014 OneLobby <http://www.onelobby.com> | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
55
main.js
var api_key = 'key-8jfyvg-hmaluaz28r74hr0l187ky2zz0'; | ||
var domain = 'onelobby.mailgun.org'; | ||
var Q = require('q'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var qs = require('querystring'); | ||
var Mailgun = require('./lib/mailgun'); | ||
var auth = require('./test/auth.json'); | ||
var fixture = require('./test/fixture.json'); | ||
@@ -10,24 +15,50 @@ //var mailgun = require('./mailgun')(auth.api_key, auth.domain); | ||
var data = { | ||
var filepath = path.join(__dirname, '/LICENSE.txt'); | ||
var filepat2 = path.join(__dirname, '/test/fixture.json'); | ||
var filepath3 = path.join(__dirname, 'package.json'); | ||
var file1 = fs.readFileSync(filepath); | ||
var file2 = fs.readFileSync(filepat2); | ||
var attch = new Mailgun.Attachment(file1, '/LICENSE.txt'); | ||
var sendData = { | ||
from: 'Excited User <me@samples.mailgun.org>', | ||
to: 'dbojan@gmail.com', | ||
subject: 'Hello', | ||
text: 'Testing some Mailgun awesomness!' | ||
text: 'Testing some Mailgun awesomness!', | ||
attachment: [attch, file2, filepath3] | ||
}; | ||
mailgun.get('/stats', {event: 'sent' }, function (err, body) { | ||
mailgun.messages().send(sendData).then(function (body) { | ||
//if (err) console.log(err); | ||
console.log(body); | ||
}); | ||
/*mailgun.mailboxes().update({mailbox: 'samplemailbox'}).then(function (body) { | ||
/*mailgun.get('/stats', { event: ['sent', 'delivered'] }, function (err, body) { | ||
console.log(body); | ||
}, function (err) { | ||
console.log('err'); | ||
console.log(err); | ||
});*/ | ||
/*mailgun.unsubscribes().list().then(function (body) { | ||
console.log(body); | ||
}, function(err) { | ||
console.log(err); | ||
});*/ | ||
/*mailgun.lists().create(fixture.mailingList, function (err, body) { | ||
var list = mailgun.lists(fixture.mailingList.address); | ||
var p1 = list.info(); | ||
var bob = { | ||
subscribed: true, | ||
address: 'bob@gmail.com', | ||
name: 'Bob Bar', | ||
vars: {age: 26} | ||
}; | ||
var p2 = list.members().create(bob); | ||
var p3 = list.members().list(); | ||
Q.all([p1, p2, p3]).done(function () { | ||
console.log("Done!"); | ||
}); | ||
});*/ | ||
@@ -8,3 +8,3 @@ { | ||
"keywords": ["email", "mailgun"], | ||
"version": "0.3.5", | ||
"version": "0.4.2", | ||
"homepage": "https://github.com/1lobby/mailgun-js", | ||
@@ -22,3 +22,9 @@ "license": "MIT", | ||
}, | ||
"main": "./mailgun.js", | ||
"main": "./lib/mailgun.js", | ||
"dependencies": { | ||
"form-data": "~0.1.2", | ||
"inflection": "~1.2.6", | ||
"path-proxy": "~1.0", | ||
"q": "~1.0.1" | ||
}, | ||
"devDependencies": { | ||
@@ -25,0 +31,0 @@ "mocha": "*" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62505
25
806
4
1
0
2
2
+ Addedform-data@~0.1.2
+ Addedinflection@~1.2.6
+ Addedpath-proxy@~1.0
+ Addedq@~1.0.1
+ Addedasync@0.9.2(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedform-data@0.1.4(transitive)
+ Addedinflection@1.2.71.3.8(transitive)
+ Addedmime@1.2.11(transitive)
+ Addedpath-proxy@1.0.0(transitive)
+ Addedq@1.0.1(transitive)