_ = require('underscore') PersonalEmailLayout = require("./Layouts/PersonalEmailLayout") NotificationEmailLayout = require("./Layouts/NotificationEmailLayout") settings = require("settings-sharelatex") templates = {} templates.welcome = subject: _.template "Welcome to ShareLaTeX" layout: PersonalEmailLayout type:"lifecycle" compiledTemplate: _.template '''

Hi <%= first_name %>,

Thanks for signing up to ShareLaTeX! If you ever get lost, you can log in again here.

If you're new to LaTeX, take a look at our Help Guides and Templates.

Regards,
Henry
ShareLaTeX Co-founder

PS. We love talking to our users about ShareLaTeX. Reply to this email to get in touch us with us directly, whatever the reason. Questions, comments, problems, suggestions, all welcome!

''' templates.canceledSubscription = subject: _.template "ShareLaTeX thoughts" layout: PersonalEmailLayout type:"lifecycle" compiledTemplate: _.template '''

Hi <%= first_name %>,

I'm sorry to see you cancelled your ShareLaTeX premium account. Would you mind giving me some advice on what the site is lacking at the moment? Feedback from our users is the only way we can improve ShareLaTeX.

Thank you in advance.

Henry
ShareLaTeX Co-founder

''' templates.passwordResetRequested = subject: _.template "Password Reset - ShareLatex.com" layout: NotificationEmailLayout type:"notification" compiledTemplate: _.template '''

Password Reset

We got a request to reset your ShareLaTeX password.

Reset password
If you ignore this message, your password won't be changed.

If you didn't request a password reset, let us know.

Thank you

ShareLatex.com

''' templates.projectSharedWithYou = subject: _.template "<%= owner.email %> wants to share <%= project.name %> with you" layout: NotificationEmailLayout type:"notification" compiledTemplate: _.template '''

Hi, <%= owner.email %> wants to share '<%= project.name %>' with you

 

View Project

Thank you

ShareLatex.com

''' module.exports = buildEmail: (templateName, opts)-> template = templates[templateName] opts.siteUrl = settings.siteUrl opts.body = template.compiledTemplate(opts) return { subject : template.subject(opts) html: template.layout(opts) type:template.type }