_ = require('underscore') PersonalEmailLayout = require("./Layouts/PersonalEmailLayout") NotificationEmailLayout = require("./Layouts/NotificationEmailLayout") settings = require("settings-sharelatex") templates = {} templates.registered = subject: _.template "Activate your #{settings.appName} Account" layout: PersonalEmailLayout type: "notification" compiledTemplate: _.template """
Congratulations, you've just had an account created for you on #{settings.appName} with the email address "<%= to %>".
Click here to set your password and log in.
Once you have reset your password you can log in here.
If you have any questions or problems, please contact #{settings.adminEmail}.
""" 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
We got a request to reset your #{settings.appName} password.
If you didn't request a password reset, let us know.
Thank you
""" 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
Thank you
""" module.exports = templates: templates 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 }