Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ class RegisterService(val rawlsDao: RawlsDAO,
}

def generateWelcomeEmail(userInfo: UserInfo): Notification =
// If the user is a B2C user and does not have a Google access token, we can safely assume that they're an Azure user
userInfo.googleAccessTokenThroughB2C match {
case None if userInfo.isB2C => AzurePreviewActivationNotification(WorkbenchUserId(userInfo.id))
case _ => ActivationNotification(WorkbenchUserId(userInfo.id))
}
ActivationNotification(WorkbenchUserId(userInfo.id))

private def registerUser(userInfo: UserInfo, termsOfService: Option[String]): Future[RegistrationInfo] =
samDao.registerUser(termsOfService)(userInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class RegisterServiceSpec extends AnyFlatSpec with Matchers with BeforeAndAfterE

"generateWelcomeEmail" should "generate an Azure welcome email for Azure B2C users" in {
val notification = registerService.generateWelcomeEmail(azureB2CUserInfo)
notification.getClass.getName shouldBe AzurePreviewActivationNotification.getClass.getName.stripSuffix("$")
notification.getClass.getName shouldBe ActivationNotification.getClass.getName.stripSuffix("$")
}

it should "generate a standard welcome email for Google B2C users" in {
Expand Down
Loading