Kaynağa Gözat

renamed email templator -> email builder

Henry Oswald 12 yıl önce
ebeveyn
işleme
eb92e5832b

+ 5 - 0
services/web/app/coffee/Features/Email/EmailTemplator.coffee → services/web/app/coffee/Features/Email/EmailBuilder.coffee

@@ -10,6 +10,7 @@ templates = {}
 templates.welcome =	
 	subject:  _.template "Welcome to ShareLaTeX"
 	layout: PersonalEmailLayout
+	type:"lifecycle"
 	compiledTemplate: _.template '''
 Hi {{first_name}}, thanks for signing up to ShareLaTeX. If you ever get lost, you can log in again <a href="https://www.sharelatex.com/login">here</a>.
 <p>
@@ -25,6 +26,7 @@ ShareLaTeX Co-founder
 templates.canceledSubscription = 
 	subject:  _.template "ShareLaTeX thoughts"
 	layout: PersonalEmailLayout
+	type:"lifecycle"
 	compiledTemplate: _.template '''
 Hi {{first_name}},
 
@@ -40,6 +42,7 @@ ShareLaTeX Co-founder
 templates.passwordReset =	
 	subject:  _.template "Password Reset - ShareLatex.com"
 	layout: NotificationEmailLayout
+	type:"notification"
 	compiledTemplate: _.template '''
 <h1 class="h1">Password Reset</h1>
 <p>
@@ -55,6 +58,7 @@ please <a href="https://www.sharelatex.com/login">login here</a> and then change
 templates.projectSharedWithYou = 
 	subject: _.template "{{owner.email}} wants to share {{project.name}} with you"
 	layout: NotificationEmailLayout
+	type:"notification"
 	compiledTemplate: _.template '''
 <h1 class="h1">{{owner.email}} wants to share <a href="{{project.url}}">'{{project.name}}'</a> with you</h1>
 <p>&nbsp;</p>
@@ -81,5 +85,6 @@ module.exports =
 		return {
 			subject : template.subject(opts)
 			html: template.layout(opts)
+			type:template.type
 		}
 

+ 4 - 4
services/web/test/UnitTests/coffee/Email/EmailTemplatorTests.coffee → services/web/test/UnitTests/coffee/Email/EmailBuilderTests.coffee

@@ -3,7 +3,7 @@ SandboxedModule = require('sandboxed-module')
 assert = require('assert')
 path = require('path')
 sinon = require('sinon')
-modulePath = path.join __dirname, "../../../../app/js/Features/Email/EmailTemplator"
+modulePath = path.join __dirname, "../../../../app/js/Features/Email/EmailBuilder"
 expect = require("chai").expect
 _ = require('underscore')
 _.templateSettings =
@@ -14,7 +14,7 @@ describe "Email Templator ", ->
 	beforeEach ->
 
 		@settings = {}
-		@EmailTemplator = SandboxedModule.require modulePath, requires:
+		@EmailBuilder = SandboxedModule.require modulePath, requires:
 			"settings-sharelatex":@settings
 			"logger-sharelatex": log:->
 
@@ -24,7 +24,7 @@ describe "Email Templator ", ->
 			@opts =
 				to:"bob@bob.com"
 				first_name:"bob"
-			@email = @EmailTemplator.buildEmail("welcome", @opts)
+			@email = @EmailBuilder.buildEmail("welcome", @opts)
 
 		it "should insert the first_name into the template", ->
 			@email.html.indexOf(@opts.first_name).should.not.equal -1
@@ -42,7 +42,7 @@ describe "Email Templator ", ->
 				project:
 					url:"http://www.project.com"
 					name:"standard project"
-			@email = @EmailTemplator.buildEmail("projectSharedWithYou", @opts)
+			@email = @EmailBuilder.buildEmail("projectSharedWithYou", @opts)
 
 		it "should insert the owner email into the template", ->
 			@email.html.indexOf(@opts.owner.email).should.not.equal -1