summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Partridge <partkyle@gmail.com>2012-01-05 17:51:42 -0800
committerKyle Partridge <partkyle@gmail.com>2012-01-05 17:51:42 -0800
commitb059a333829b23517cdade1e9927598ea3fe617c (patch)
tree89de4b7e2130e407a66d7f35e9b1bb07c0076fbe
parent08ab03d689310ebe89ca9b673ecdc8bd32abd150 (diff)
downloadsendgrid-nodejs-b059a333829b23517cdade1e9927598ea3fe617c.zip
sendgrid-nodejs-b059a333829b23517cdade1e9927598ea3fe617c.tar.gz
sendgrid-nodejs-b059a333829b23517cdade1e9927598ea3fe617c.tar.bz2
moved my changes over
-rw-r--r--.gitignore2
-rw-r--r--index.js0
-rw-r--r--lib/email.js6
-rw-r--r--lib/mail.js39
-rw-r--r--package.json21
-rw-r--r--spec/index.spec.js5
-rw-r--r--spec/lib/email.spec.js5
-rw-r--r--spec/lib/mail.spec.js6
-rw-r--r--spec/spec_helper.js4
9 files changed, 88 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ca9571
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/index.js
diff --git a/lib/email.js b/lib/email.js
new file mode 100644
index 0000000..ebcd775
--- /dev/null
+++ b/lib/email.js
@@ -0,0 +1,6 @@
+function Email(email, name) {
+ this.email = email || '';
+ this.name = name;
+}
+
+module.exports.Email = Email; \ No newline at end of file
diff --git a/lib/mail.js b/lib/mail.js
new file mode 100644
index 0000000..19296f6
--- /dev/null
+++ b/lib/mail.js
@@ -0,0 +1,39 @@
+"use strict";
+
+var Email = require('./email').Email;
+
+function SmtpapiHeaders() {
+
+}
+
+function MailHeaders() {
+
+}
+
+function Mail(attributes) {
+ attributes = attributes || {};
+
+ this.to = attributes.to || new Email();
+ this.from = attributes.from || new Email();
+ this.smtpapi = attributes.smtpapi || new SmtpapiHeaders();
+ this.subject = attributes.subject || '';
+ this.text = attributes.text || '';
+ this.html = attributes.html || '';
+ this.bcc = attributes.bcc || [];
+ this.replyto = attributes.replyto || '';
+ this.date = attributes.date || new Date();
+ this.files = attributes.files || [];
+ this.headers = attributes.headers || new MailHeaders();
+}
+
+/*
+ * Sends an email and returns true if the
+ * message was sent successfully.
+ *
+ * @returns boolean
+ */
+Mail.prototype.send = function () {
+ return false;
+};
+
+module.exports.Mail = Mail;
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..308675e
--- /dev/null
+++ b/package.json
@@ -0,0 +1,21 @@
+{
+ "author": "SendGrid <info@sendgrid.com> (sendgrid.com)",
+ "name": "sendgrid",
+ "description": "A NodeJS implementation of the SendGrid Api.",
+ "version": "0.0.0",
+ "homepage": "sendgrid.com",
+ "repository": {
+ "url": ""
+ },
+ "engines": {
+ "node": "~0.6.6"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "jasmine-node" : ">= 1.0.13",
+ "should" : ">= 0.4.2"
+ },
+ "scripts": {
+ "test": "jasmine-node spec"
+ }
+}
diff --git a/spec/index.spec.js b/spec/index.spec.js
new file mode 100644
index 0000000..41a5bfe
--- /dev/null
+++ b/spec/index.spec.js
@@ -0,0 +1,5 @@
+describe("index.js", function () {
+ it("should exist", function () {
+ require('../index').should.not.be.undefined;
+ });
+});
diff --git a/spec/lib/email.spec.js b/spec/lib/email.spec.js
new file mode 100644
index 0000000..4f23001
--- /dev/null
+++ b/spec/lib/email.spec.js
@@ -0,0 +1,5 @@
+describe('Email', function () {
+ it('should default to an empty string', function () {
+
+ });
+});
diff --git a/spec/lib/mail.spec.js b/spec/lib/mail.spec.js
new file mode 100644
index 0000000..0847206
--- /dev/null
+++ b/spec/lib/mail.spec.js
@@ -0,0 +1,6 @@
+describe('Mail', function () {
+ it("should be able to send mail", function () {
+ var mail = new Mail();
+ mail.send().should.be.true;
+ });
+});
diff --git a/spec/spec_helper.js b/spec/spec_helper.js
new file mode 100644
index 0000000..5d6d847
--- /dev/null
+++ b/spec/spec_helper.js
@@ -0,0 +1,4 @@
+var should = require('should')
+ , Mail = require('../lib/mail').Mail;
+
+module.exports.Mail = Mail;