2014-03-04 18:10:06 +00:00
_ = require ( ' underscore ' )
PersonalEmailLayout = require ( " ./Layouts/PersonalEmailLayout " )
NotificationEmailLayout = require ( " ./Layouts/NotificationEmailLayout " )
2014-06-17 15:28:52 +00:00
settings = require ( " settings-sharelatex " )
2014-03-04 18:10:06 +00:00
templates = { }
templates.welcome =
subject: _ . template " Welcome to ShareLaTeX "
layout: PersonalEmailLayout
2014-03-05 11:22:34 +00:00
type : " lifecycle "
2014-03-04 18:10:06 +00:00
compiledTemplate: _ . template '''
2014-10-16 11:46:38 +00:00
< p > Hi < %= first_name % > , < / p >
2014-03-04 18:10:06 +00:00
2014-10-16 11:46:38 +00:00
< p > Thanks for signing up to ShareLaTeX ! If you ever get lost , you can log in again < a href = " <%= siteUrl %>/login " > here < / a > . < / p >
< p > If you ' re new to LaTeX, take a look at our <a href= " <%= siteUrl %>/learn " >Help Guides</a> and <a href= " <%= siteUrl %>/templates " >Templates</a>.</p>
2014-03-04 18:10:06 +00:00
2014-10-16 11:46:38 +00:00
< p >
2014-03-04 18:10:06 +00:00
Regards , < br >
Henry < br >
ShareLaTeX Co - founder
2014-10-16 11:46:38 +00:00
< / p >
< p > 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 ! < p >
2014-03-04 18:10:06 +00:00
'''
templates.canceledSubscription =
subject: _ . template " ShareLaTeX thoughts "
layout: PersonalEmailLayout
2014-03-05 11:22:34 +00:00
type : " lifecycle "
2014-03-04 18:10:06 +00:00
compiledTemplate: _ . template '''
2014-10-16 11:46:38 +00:00
< p > Hi < %= first_name % > , < / p >
2014-03-04 18:10:06 +00:00
2014-10-16 11:46:38 +00:00
< p > 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.</p>
2014-03-04 18:10:06 +00:00
2014-10-16 11:46:38 +00:00
< p > Thank you in advance . < / p >
2014-03-04 18:10:06 +00:00
< p >
Henry < br >
ShareLaTeX Co - founder
2014-10-16 11:46:38 +00:00
< / p >
2014-03-04 18:10:06 +00:00
'''
2014-05-15 16:58:25 +00:00
templates.passwordResetRequested =
2014-03-04 18:10:06 +00:00
subject: _ . template " Password Reset - ShareLatex.com "
layout: NotificationEmailLayout
2014-03-05 11:22:34 +00:00
type : " notification "
2014-03-04 18:10:06 +00:00
compiledTemplate: _ . template '''
< h1 class = " h1 " > Password Reset < / h1 >
< p >
2014-05-15 16:58:25 +00:00
We got a request to reset your ShareLaTeX password .
2014-03-05 15:45:24 +00:00
< p >
2014-05-15 16:58:25 +00:00
< center >
2014-07-21 13:18:11 +00:00
< div style = " width:200px;background-color: # a93629;border:1px solid # e24b3b;border-radius:3px;padding:15px; margin:12.5px; " >
2014-05-15 16:58:25 +00:00
< div style = " padding-right:10px;padding-left:10px " >
< a href = " <%= setNewPasswordUrl %> " style = " text-decoration:none " target = " _blank " >
< span style= " font-size:16px;font-family:Arial;font-weight:bold;color: # fff;white-space:nowrap;display:block; text-align:center " >
Reset password
< / span >
< / a >
< / div >
< / div >
< / center >
If you ignore this message , your password won ' t be changed.
< p >
If you didn ' t request a password reset, let us know.
2014-03-04 18:10:06 +00:00
< / p >
< p > Thank you < / p >
2014-06-17 15:28:52 +00:00
< p > < a href = " <%= siteUrl %> " > ShareLatex . com < / a > < / p >
2014-03-04 18:10:06 +00:00
'''
templates.projectSharedWithYou =
2014-03-06 12:28:07 +00:00
subject: _ . template " <%= owner.email %> wants to share <%= project.name %> with you "
2014-03-04 18:10:06 +00:00
layout: NotificationEmailLayout
2014-03-05 11:22:34 +00:00
type : " notification "
2014-03-04 18:10:06 +00:00
compiledTemplate: _ . template '''
2014-07-21 13:18:11 +00:00
< p > Hi , < %= owner . email % > wants to share < a href = " <%= project.url %> " > ' <%= project.name %> ' < / a > with you < / p >
2014-03-04 18:10:06 +00:00
< p > & nbsp ; < / p >
< center >
2014-07-21 13:18:11 +00:00
< div style = " width:200px;background-color: # a93629;border:1px solid # e24b3b;border-radius:3px;padding:15px; margin:12.5px; " >
2014-03-04 18:10:06 +00:00
< div style = " padding-right:10px;padding-left:10px " >
2014-03-06 12:28:07 +00:00
< a href = " <%= project.url %> " style = " text-decoration:none " target = " _blank " >
2014-07-21 13:18:11 +00:00
< span style= " font-size:16px;font-family:Helvetica,Arial;font-weight:400;color: # fff;white-space:nowrap;display:block; text-align:center " >
2014-03-04 18:10:06 +00:00
View Project
< / span >
< / a >
< / div >
< / div >
< / center >
< p > Thank you < / p >
2014-06-17 15:28:52 +00:00
< p > < a href = " <%= siteUrl %> " > ShareLatex . com < / a > < / p >
2014-07-21 13:18:11 +00:00
2014-03-04 18:10:06 +00:00
'''
module.exports =
buildEmail: (templateName, opts)->
template = templates [ templateName ]
2014-06-17 15:28:52 +00:00
opts.siteUrl = settings . siteUrl
2014-03-04 18:10:06 +00:00
opts.body = template . compiledTemplate ( opts )
return {
subject : template . subject ( opts )
html: template . layout ( opts )
2014-03-05 11:22:34 +00:00
type : template . type
2014-03-04 18:10:06 +00:00
}