Skip to content

Commit

Permalink
Merge pull request #1 from kevinejohn/master
Browse files Browse the repository at this point in the history
[FEATURE] Added plain text in verification email
  • Loading branch information
rook2pawn committed May 9, 2014
2 parents b397ef2 + 8702a6b commit f9181de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ var hyperglue = require('hyperglue');
var config = require('../config');
var fs = require('fs');
var contents = fs.readFileSync(__dirname+ '/email.html');
var contents_txt = fs.readFileSync(__dirname+ '/email.txt', 'utf8');
var email = require('emailjs');
var server = email.server.connect({
user: config.email.user,
password:config.email.password,
host: config.email.host,
user: config.email.user,
password:config.email.password,
host: config.email.host,
ssl: true
});
var generateMessage = function(email,token,name,hostlink) {
var message = {
text: "Welcome to RippleTrade! Verify your email",
from: "you <[email protected]>",
text: contents_txt.replace('_VERIFY_URL_', hostlink + '/' + name + '/'+token),
from: "you <[email protected]>",
to: "someone <[email protected]>",
subject: "Ripple Trade",
'Reply-to' : '[email protected]',
attachment:
attachment:
[
{
data:undefined,
Expand All @@ -40,7 +41,7 @@ exports.send = function(params) {
var token = params.token;
var hostlink = params.hostlink
var message = generateMessage(email,token,name,hostlink);
server.send(message, function(err, message) {
//console.log(err || message);
server.send(message, function(err, message) {
//console.log(err || message);
});
}
6 changes: 6 additions & 0 deletions lib/email.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Welcome to Ripple Trade!
To get started, please verify your email address below:
_VERIFY_URL_
Thanks,
The Ripple Trade team
If you did not sign up for a Ripple account, please disregard this email.

0 comments on commit f9181de

Please sign in to comment.