mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Remove dead code
This commit is contained in:
parent
3bd18715db
commit
7fcdf68296
4 changed files with 0 additions and 54 deletions
|
@ -144,31 +144,6 @@ Thank You
|
|||
gmailGoToAction: null
|
||||
})
|
||||
|
||||
templates.completeJoinGroupAccount =
|
||||
subject: _.template "Verify Email to join <%= group_name %> group"
|
||||
layout: BaseWithHeaderEmailLayout
|
||||
type:"notification"
|
||||
plainTextTemplate: _.template """
|
||||
Hi, please verify your email to join the <%= group_name %> and get your free premium account
|
||||
|
||||
Click this link to verify now: <%= completeJoinUrl %>
|
||||
|
||||
Thank You
|
||||
|
||||
#{settings.appName} - <%= siteUrl %>
|
||||
"""
|
||||
compiledTemplate: (opts) ->
|
||||
SingleCTAEmailBody({
|
||||
title: "Verify Email to join #{ opts.group_name } group"
|
||||
greeting: "Hi,"
|
||||
message: "please verify your email to join the #{ opts.group_name } group and get your free premium account."
|
||||
secondaryMessage: null
|
||||
ctaText: "Verify now"
|
||||
ctaURL: opts.completeJoinUrl
|
||||
gmailGoToAction: null
|
||||
})
|
||||
|
||||
|
||||
templates.testEmail =
|
||||
subject: _.template "A Test Email from ShareLaTeX"
|
||||
layout: BaseWithHeaderEmailLayout
|
||||
|
|
|
@ -71,16 +71,6 @@ module.exports = SubscriptionGroupHandler =
|
|||
logger.log user_id:user_id, subscription_id:subscription_id, partOfGroup:partOfGroup, "checking if user is part of a group"
|
||||
callback(err, partOfGroup)
|
||||
|
||||
|
||||
sendVerificationEmail: (subscription_id, licenceName, email, callback)->
|
||||
ONE_DAY_IN_S = 1000 * 60 * 60 * 24
|
||||
OneTimeTokenHandler.getNewToken subscription_id, {expiresIn:ONE_DAY_IN_S}, (err, token)->
|
||||
opts =
|
||||
to : email
|
||||
group_name: licenceName
|
||||
completeJoinUrl: "#{settings.siteUrl}/user/subscription/#{subscription_id}/group/complete-join?token=#{token}"
|
||||
EmailHandler.sendEmail "completeJoinGroupAccount", opts, callback
|
||||
|
||||
buildUserViewModel = (user)->
|
||||
u =
|
||||
email: user.email
|
||||
|
|
|
@ -25,7 +25,6 @@ describe "SubscriptionGroupController", ->
|
|||
addUserToGroup: sinon.stub().callsArgWith(2, null, @user)
|
||||
removeUserFromGroup: sinon.stub().callsArgWith(2)
|
||||
isUserPartOfGroup: sinon.stub()
|
||||
sendVerificationEmail:sinon.stub()
|
||||
getPopulatedListOfMembers: sinon.stub().callsArgWith(1, null, [@user])
|
||||
@SubscriptionLocator = getUsersSubscription: sinon.stub().callsArgWith(1, null, @subscription)
|
||||
@AuthenticationController =
|
||||
|
|
|
@ -179,21 +179,3 @@ describe "SubscriptionGroupHandler", ->
|
|||
@Handler.isUserPartOfGroup @user_id, @subscription_id, (err, partOfGroup)->
|
||||
partOfGroup.should.equal false
|
||||
done()
|
||||
|
||||
|
||||
describe "sendVerificationEmail", ->
|
||||
beforeEach ->
|
||||
@token = "secret token"
|
||||
@subscription_id = "123ed13123"
|
||||
@licenceName = "great licnece"
|
||||
@email = "bob@smith.com"
|
||||
@OneTimeTokenHandler.getNewToken.callsArgWith(2, null, @token)
|
||||
@EmailHandler.sendEmail.callsArgWith(2)
|
||||
|
||||
it "should put a one time token into the email", (done)->
|
||||
@Handler.sendVerificationEmail @subscription_id, @licenceName, @email, (err)=>
|
||||
emailOpts = @EmailHandler.sendEmail.args[0][1]
|
||||
emailOpts.completeJoinUrl.should.equal "#{@settings.siteUrl}/user/subscription/#{@subscription_id}/group/complete-join?token=#{@token}"
|
||||
emailOpts.to.should.equal @email
|
||||
emailOpts.group_name.should.equal @licenceName
|
||||
done()
|
||||
|
|
Loading…
Reference in a new issue