Merge branch 'sk-launchpad'

This commit is contained in:
Shane Kilkelly 2017-01-20 13:58:16 +00:00
commit cfa2777d62
2 changed files with 36 additions and 3 deletions

View file

@ -123,8 +123,6 @@ Thank you
description: "Join #{ opts.project.name } at ShareLaTeX"
})
templates.completeJoinGroupAccount =
subject: _.template "Verify Email to join <%= group_name %> group"
layout: BaseWithHeaderEmailLayout
@ -149,6 +147,30 @@ Thank You
gmailGoToAction: null
})
templates.testEmail =
subject: _.template "A Test Email from ShareLaTeX"
layout: BaseWithHeaderEmailLayout
type:"notification"
plainTextTemplate: _.template """
Hi,
This is a test email sent from ShareLaTeX.
#{settings.appName} - <%= siteUrl %>
"""
compiledTemplate: (opts) ->
SingleCTAEmailBody({
title: "A Test Email from ShareLaTeX"
greeting: "Hi,"
message: "This is a test email sent from ShareLaTeX"
secondaryMessage: null
ctaText: "Open ShareLaTeX"
ctaURL: "/"
gmailGoToAction: null
})
module.exports =
templates: templates
@ -163,4 +185,4 @@ module.exports =
html: template.layout(opts)
text: template?.plainTextTemplate?(opts)
type:template.type
}
}

View file

@ -33,6 +33,11 @@ define [
response.success = true
response.error = false
onSuccessHandler = scope[attrs.onSuccess]
if onSuccessHandler
onSuccessHandler(data, status, headers, config)
return
if data.redir?
ga('send', 'event', formName, 'success')
window.location = data.redir
@ -50,6 +55,12 @@ define [
scope[attrs.name].inflight = false
response.success = false
response.error = true
onErrorHandler = scope[attrs.onError]
if onErrorHandler
onErrorHandler(data, status, headers, config)
return
if status == 403 # Forbidden
response.message =
text: "Session error. Please check you have cookies enabled. If the problem persists, try clearing your cache and cookies."