Fix email templates path, signup message.

This commit is contained in:
Jonathan Cremin 2015-08-09 10:55:10 +01:00
parent 0d762bb416
commit 84e5925135
2 changed files with 8 additions and 3 deletions

View file

@ -2,7 +2,7 @@ import crypto from 'crypto';
import passwords from 'passwords';
import uuid from 'node-uuid';
import views from 'co-views';
const render = views('views', { default: 'ejs'});
const render = views(__dirname + '/../views', { default: 'ejs'});
import debugname from 'debug';
const debug = debugname('hostr-web:auth');
import { Mandrill } from 'mandrill-api/mandrill';
@ -131,9 +131,9 @@ export function* sendResetToken(ctx, email) {
'token': token,
'created': Math.round(new Date().getTime() / 1000)
});
const html = yield this.render('email/inlined/forgot', {forgotUrl: this.locals.baseUrl + '/forgot/' + token});
const html = yield render('email/inlined/forgot', {forgotUrl: process.env.BASE_URL + '/forgot/' + token});
const text = `It seems you've forgotten your password :(
Visit ${ctx.locals.baseUrl + '/forgot/' + token} to set a new one.
Visit ${process.env.BASE_URL + '/forgot/' + token} to set a new one.
`;
mandrill.messages.send({message: {
html: html,

View file

@ -18,6 +18,11 @@
<section class="container user-form clearfix">
<p class="lead">Sign up to Hostr.</p>
<% if(typeof message !== 'undefined') { %>
<div class="alert alert-success alert-signin">
<%= message %>
</div>
<% } %>
<div class="holder">
<form role="form" action="/signup" method="post">
<% if(typeof error !== 'undefined') { %>