mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #893 from sharelatex/ja-fix-duplicate-text-in-email
Don't include the license name twice in invite emails
This commit is contained in:
commit
6d5908f2f4
2 changed files with 24 additions and 1 deletions
|
@ -50,7 +50,9 @@ module.exports = TeamInvitesHandler =
|
|||
email = EmailHelper.parseEmail(user.email)
|
||||
return callback(new Error('invalid email')) if !email?
|
||||
logger.log {licence, email: email}, "Creating domain team invite"
|
||||
inviterName = licence.name.replace(/\s+licence$/i, licence.name)
|
||||
# If name == 'Uni of X License', make the email read only
|
||||
# 'Uni of X has invited you...'
|
||||
inviterName = licence.name.replace(/\s+(site\s+)?licence$/i, '')
|
||||
|
||||
SubscriptionLocator.getSubscription licence.subscription_id, (error, subscription) ->
|
||||
return callback(error) if error?
|
||||
|
|
|
@ -176,6 +176,27 @@ describe "TeamInvitesHandler", ->
|
|||
).should.equal true
|
||||
done()
|
||||
|
||||
it "stripe licence from name", (done) ->
|
||||
@licence.name = 'Foo Licence'
|
||||
@TeamInvitesHandler.createDomainInvite @user, @licence, (err, invite) =>
|
||||
@EmailHandler.sendEmail.calledWith("verifyEmailToJoinTeam",
|
||||
sinon.match({
|
||||
inviterName: 'Foo'
|
||||
})
|
||||
).should.equal true
|
||||
done()
|
||||
|
||||
|
||||
it "stripe site licence from name", (done) ->
|
||||
@licence.name = 'Foo Site Licence'
|
||||
@TeamInvitesHandler.createDomainInvite @user, @licence, (err, invite) =>
|
||||
@EmailHandler.sendEmail.calledWith("verifyEmailToJoinTeam",
|
||||
sinon.match({
|
||||
inviterName: 'Foo'
|
||||
})
|
||||
).should.equal true
|
||||
done()
|
||||
|
||||
describe "importInvite", ->
|
||||
beforeEach ->
|
||||
@sentAt = new Date()
|
||||
|
|
Loading…
Reference in a new issue