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 @@ -9,7 +9,7 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageId>Google.Ads.DataManager.Util</PackageId>
<Version>0.1.0</Version>
<Version>0.2.0</Version>
<Authors>Google</Authors>
<Description>A library to help with common tasks for the Google Ads Data Manager API.</Description>
<PackageTags>Google Ads Data Manager API</PackageTags>
Expand Down
1 change: 1 addition & 0 deletions Google.Ads.DataManager.Util/src/UserDataFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public string FormatEmailAddress(string emailAddress)

if (domain == "gmail.com" || domain == "googlemail.com")
{
username = username.Split('+')[0];
Comment thread
lindsey-volta marked this conversation as resolved.
username = PeriodPattern.Replace(username, "");
}

Expand Down
12 changes: 12 additions & 0 deletions Google.Ads.DataManager.Util/tests/UserDataFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public void TestFormatEmailAddress_ValidInputs()
_formatter.FormatEmailAddress("QuinnY@EXAMPLE.com"),
Is.EqualTo("quinny@example.com")
);
Assert.That(
_formatter.FormatEmailAddress("user.name+NYC@Example.com"),
Is.EqualTo("user.name+nyc@example.com")
);
}

[Test]
Expand Down Expand Up @@ -61,6 +65,14 @@ public void TestFormatEmailAddress_GmailVariations()
_formatter.FormatEmailAddress("j.e.f..ferson.Loves.hiking@googlemail.com"),
Is.EqualTo("jeffersonloveshiking@googlemail.com")
);
Assert.That(
_formatter.FormatEmailAddress("Cloudy.SanFrancisco+shopping@gmail.com"),
Is.EqualTo("cloudysanfrancisco@gmail.com")
);
Assert.That(
_formatter.FormatEmailAddress("Cloudy.SanFrancisco+shopping@googlemail.com"),
Is.EqualTo("cloudysanfrancisco@googlemail.com")
);
}

[Test]
Expand Down