links in emails use site url

This commit is contained in:
Henry Oswald 2014-06-17 16:28:52 +01:00
parent 92d1d4ca1a
commit 426b699865

View file

@ -2,6 +2,7 @@ _ = require('underscore')
PersonalEmailLayout = require("./Layouts/PersonalEmailLayout") PersonalEmailLayout = require("./Layouts/PersonalEmailLayout")
NotificationEmailLayout = require("./Layouts/NotificationEmailLayout") NotificationEmailLayout = require("./Layouts/NotificationEmailLayout")
settings = require("settings-sharelatex")
templates = {} templates = {}
@ -10,7 +11,7 @@ templates.welcome =
layout: PersonalEmailLayout layout: PersonalEmailLayout
type:"lifecycle" type:"lifecycle"
compiledTemplate: _.template ''' compiledTemplate: _.template '''
Hi <%= first_name %>, thanks for signing up to ShareLaTeX. If you ever get lost, you can log in again <a href="https://www.sharelatex.com/login">here</a>. Hi <%= first_name %>, thanks for signing up to ShareLaTeX. If you ever get lost, you can log in again <a href="<%= siteUrl %>/login">here</a>.
<p> <p>
Im the co-founder of ShareLaTeX and I love talking to our users about our service. Please feel free to get in touch by replying to this email and I will get back to you within a day. Im the co-founder of ShareLaTeX and I love talking to our users about our service. Please feel free to get in touch by replying to this email and I will get back to you within a day.
@ -64,7 +65,7 @@ If you didn't request a password reset, let us know.
</p> </p>
<p>Thank you</p> <p>Thank you</p>
<p> <a href="https://www.sharelatex.com"> ShareLatex.com </a></p> <p> <a href="<%= siteUrl %>"> ShareLatex.com </a></p>
''' '''
templates.projectSharedWithYou = templates.projectSharedWithYou =
@ -86,13 +87,14 @@ templates.projectSharedWithYou =
</div> </div>
</center> </center>
<p> Thank you</p> <p> Thank you</p>
<p> <a href="https://www.sharelatex.com"> ShareLatex.com </a></p> <p> <a href="<%= siteUrl %>"> ShareLatex.com </a></p>
''' '''
module.exports = module.exports =
buildEmail: (templateName, opts)-> buildEmail: (templateName, opts)->
template = templates[templateName] template = templates[templateName]
opts.siteUrl = settings.siteUrl
opts.body = template.compiledTemplate(opts) opts.body = template.compiledTemplate(opts)
return { return {
subject : template.subject(opts) subject : template.subject(opts)