_ = 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.
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 via this survey?
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
""" templates.completeJoinGroupAccount = subject: _.template "Verify Email to join <%= group_name %> group" layout: NotificationEmailLayout type:"notification" compiledTemplate: _.template """Hi, please verify your email to join the <%= group_name %> and get your free premium account
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 }