fuck all these email things

This commit is contained in:
typpo 2012-04-06 22:01:24 -04:00
parent af9af7d26d
commit 5630d6b78e
2 changed files with 70 additions and 1 deletions

69
app.js
View File

@ -1,8 +1,20 @@
var express = require('express') var express = require('express')
, app = express.createServer() , app = express.createServer()
, nodemailer = require('nodemailer') , nodemailer = require('nodemailer')
/*
, amazonses = require('amazon-ses')
*/
, exec = require('child_process').exec
, config = require('./config.js') , config = require('./config.js')
/*
var SendGrid = require('sendgrid').SendGrid;
var sendgrid = new SendGrid(
process.env.SENDGRID_USERNAME || 'app3740036@heroku.com',
process.env.SENDGRID_PASSWORD || 'd0y4yjqn'
)
*/
var redis; var redis;
if (process.env.NODE_ENV == 'production') if (process.env.NODE_ENV == 'production')
redis = require('redis-url').connect(process.env.REDISTOGO_URL); redis = require('redis-url').connect(process.env.REDISTOGO_URL);
@ -55,13 +67,66 @@ function dateStr() {
return mm + '/' + dd + '/' + yyyy; return mm + '/' + dd + '/' + yyyy;
} }
function validatePhone() function validatePhone() {
}
function sendText(phone, message, cb) { function sendText(phone, message, cb) {
var actual_phone = phone.replace(/\D/g, '');
//var child = process.createChildProcess('sendmail', ['-f"txt@textbelt.com"', '"9147727429@vtext.com"']);
/*
sendgrid.send({
to: '9147727429@vtext.com',
from: 'txt@textbelt.com',
subject: 'a',
text: 'Sending email with NodeJS through SendGrid!'
}, function(success, data) {
if (!success) {
console.log(data);
}
else {
console.log('message sent');
}
cb(!success);
});
*/
/*
var ses = new amazonses(config.aws.access, config.aws.secret);
ses.send({
from: 'txt@textbelt.com'
, to: ['typppo@gmail.com']
, replyTo: ['txt@textbelt.com']
, subject: ''
, body: {
text: ' Test mesg'
}
}, function(err, data) {
if (err) {
console.log(data);
}
else {
console.log('message sent');
}
cb(err);
});
*/
/*
var transport = nodemailer.createTransport("SES", { var transport = nodemailer.createTransport("SES", {
AWSAccessKeyID: config.aws.access, AWSAccessKeyID: config.aws.access,
AWSSecretKey: config.aws.secret, AWSSecretKey: config.aws.secret,
ReturnPath: 'txt@textbelt.com',
}); });
*/
/*
var transport = nodemailer.createTransport("Sendmail");
var mailOptions = { var mailOptions = {
transport: transport, // transport method to use transport: transport, // transport method to use
@ -69,7 +134,9 @@ function sendText(phone, message, cb) {
to: 'typppo@gmail.com', to: 'typppo@gmail.com',
subject: '', // Subject line subject: '', // Subject line
text: message, text: message,
ReturnPath: 'txt@textbelt.com',
} }
*/
nodemailer.sendMail(mailOptions, function(error){ nodemailer.sendMail(mailOptions, function(error){
if (error) { if (error) {

View File

@ -5,6 +5,8 @@
, "jade": "0.14.2" , "jade": "0.14.2"
, "nodemailer": "latest" , "nodemailer": "latest"
, "redis-url": "latest" , "redis-url": "latest"
, "amazon-ses": "latest"
, "sendgrid": "latest"
} }
, "devDependencies": { , "devDependencies": {
} }