From f16f049b730773c63483bb1631cb16367487e3e5 Mon Sep 17 00:00:00 2001 From: Jed Parsons <jedp@me.com> Date: Fri, 27 Jul 2012 10:40:11 -0700 Subject: [PATCH] Add VerificationURL and RelyingParty to verification email headers --- lib/email.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/email.js b/lib/email.js index 13d24ffbb..130df0a3f 100644 --- a/lib/email.js +++ b/lib/email.js @@ -30,24 +30,24 @@ if (smtp_params && smtp_params.host) { const TEMPLATE_PATH = path.join(__dirname, "static", "email_templates"); -// the underbar decorator to allow getext to extract strings +// the underbar decorator to allow getext to extract strings function _(str) { return str; } // a map of all the different emails we send const templates = { "new": { landing: 'verify_email_address', - subject: _("Confirm email address for Persona"), + subject: _("Confirm email address for Persona"), template: fs.readFileSync(path.join(TEMPLATE_PATH, 'new.ejs')), }, "reset": { landing: 'reset_password', - subject: _("Reset Persona password"), + subject: _("Reset Persona password"), template: fs.readFileSync(path.join(TEMPLATE_PATH, 'reset.ejs')), }, "confirm": { landing: 'confirm', - subject: _("Confirm email address for Persona"), + subject: _("Confirm email address for Persona"), template: fs.readFileSync(path.join(TEMPLATE_PATH, 'confirm.ejs')), } }; @@ -56,7 +56,7 @@ const templates = { Object.keys(templates).forEach(function(type) { templates[type].template = ejs.compile(templates[type].template.toString()); }); - + var interceptor = undefined; @@ -100,6 +100,10 @@ function doSend(email_type, email, site, secret, langContext) { sender: "Persona <no-reply@persona.org>", to: email, subject: GETTEXT(email_params.subject), + headers: { + 'X-BrowserID-VerificationURL': public_url, + 'X-BrowserID-RelyingParty': site + }, body: email_params.template({ link: public_url, site: site, -- GitLab