Don't include the license name twice in invite emails
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user