diff --git a/services/web/app/coffee/Features/Email/EmailBuilder.coffee b/services/web/app/coffee/Features/Email/EmailBuilder.coffee index 306aad3d2a..0a06a2a175 100644 --- a/services/web/app/coffee/Features/Email/EmailBuilder.coffee +++ b/services/web/app/coffee/Features/Email/EmailBuilder.coffee @@ -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 - } \ No newline at end of file + } diff --git a/services/web/public/coffee/directives/asyncForm.coffee b/services/web/public/coffee/directives/asyncForm.coffee index 2c6345d878..d9ca11231b 100644 --- a/services/web/public/coffee/directives/asyncForm.coffee +++ b/services/web/public/coffee/directives/asyncForm.coffee @@ -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."