Skip to content
Snippets Groups Projects
Commit ac3bfe6f authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Finish sending of confirmation emails: closes #3.

parent c26edaed
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ All of the servers here are based on node.js, and some number of 3rd party node
* sqlite (>= 1.0.3)
* mustache (>= 0.3.1)
* cookie-sessions (>= 0.0.2)
* nodemailer (>= 0.1.18)
## Getting started:
......
const db = require('./db');
const db = require('./db'),
emailer = require('nodemailer'),
fs = require('fs'),
path = require('path'),
mustache = require('mustache');
const template = fs.readFileSync(path.join(__dirname, "prove_template.txt")).toString();
exports.sendVerificationEmail = function(email, secret) {
var url = "https://browserid.org/prove.html?token=" + secret;
console.log("sending a verification email with url: " + url);
emailer.send_mail({
sender: "noreply@browserid.org",
to: email,
subject : "BrowserID: confirm email address - " + email,
body: mustache.to_html(template, { email: email, link: url })
}, function(err, success){
if(!success) console.log("error sending email: ", err);
});
};
Hello {{email}},
This message is being sent to you because someone is trying to log
into a site using this email address. If you are presently logging
into a website using BrowserID, then click the link below to complete
your login:
{{link}}
If you are NOT trying to log into a website, just delete this email.
Sincerely,
BrowserID (A better way to login)
......@@ -53,7 +53,7 @@
<div class="content">
<div class="summary">Welcome, <span class="email good"></span>. You will receive a <strong>confirmation email</strong> in a few moments. To activate your BrowserID, please <strong>visit the link</strong> included in the email.</div>
<div class="attention">
Waiting for email confirmation... <span class="bad"> THIS ISN'T REAL! JUST WAIT 5 SECONDS!</span>
Waiting for email confirmation...
</div>
<div class="actions">
<div class="action"> No email yet? <a href="#">Resend it!</a></div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment