Skip to content
Snippets Groups Projects
Commit f16f049b authored by Jed Parsons's avatar Jed Parsons
Browse files

Add VerificationURL and RelyingParty to verification email headers

parent 9ca27e00
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
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