-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add link to package in Contact Owners email #5202
Merged
+38
−21
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
add url to package in contact owners email
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,7 +208,7 @@ public void WillCopySenderIfAsked() | |
}; | ||
var messageService = TestableMessageService.Create(GetConfigurationService()); | ||
|
||
messageService.SendContactOwnersMessage(from, package, "Test message", "http://someurl/", true); | ||
messageService.SendContactOwnersMessage(from, package, "http://someurl/", "Test message", "http://someotherurl/", true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe distinguish the urls, like Should we have test to validate correct package url included? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
var messages = messageService.MockMailSender.Sent; | ||
Assert.Equal(2, messages.Count); | ||
|
@@ -226,30 +226,36 @@ public void WillCopySenderIfAsked() | |
[Fact] | ||
public void WillSendEmailToAllOwners() | ||
{ | ||
var from = new MailAddress("[email protected]", "flossy"); | ||
var id = "smangit"; | ||
var owner1Email = "[email protected]"; | ||
var owner2Email = "[email protected]"; | ||
var userEmail = "[email protected]"; | ||
var from = new MailAddress(userEmail, "flossy"); | ||
var package = new PackageRegistration | ||
{ | ||
Id = "smangit", | ||
Id = id, | ||
Owners = new[] | ||
{ | ||
new User { EmailAddress = "[email protected]", EmailAllowed = true }, | ||
new User { EmailAddress = "[email protected]", EmailAllowed = true } | ||
new User { EmailAddress = owner1Email, EmailAllowed = true }, | ||
new User { EmailAddress = owner2Email, EmailAllowed = true } | ||
} | ||
}; | ||
|
||
var messageService = TestableMessageService.Create(GetConfigurationService()); | ||
|
||
messageService.SendContactOwnersMessage(from, package, "Test message", "http://someurl/", false); | ||
var packageUrl = "http://someurl/"; | ||
messageService.SendContactOwnersMessage(from, package, packageUrl, "Test message", "http://someotherurl/", false); | ||
var message = messageService.MockMailSender.Sent.Last(); | ||
|
||
Assert.Equal("[email protected]", message.To[0].Address); | ||
Assert.Equal("[email protected]", message.To[1].Address); | ||
Assert.Equal(owner1Email, message.To[0].Address); | ||
Assert.Equal(owner2Email, message.To[1].Address); | ||
Assert.Equal(TestGalleryOwner, message.From); | ||
Assert.Equal("[email protected]", message.ReplyToList.Single().Address); | ||
Assert.Contains("[Joe Shmoe] Message for owners of the package 'smangit'", message.Subject); | ||
Assert.Equal(userEmail, message.ReplyToList.Single().Address); | ||
Assert.Contains($"[Joe Shmoe] Message for owners of the package '{id}'", message.Subject); | ||
Assert.Contains("Test message", message.Body); | ||
Assert.Contains( | ||
"User flossy <[email protected]> sends the following message to the owners of Package 'smangit'.", message.Body); | ||
$"User flossy <{userEmail}> sends the following message to the owners of Package '[{id}]({packageUrl})'.", | ||
message.Body); | ||
} | ||
|
||
[Fact] | ||
|
@@ -268,7 +274,7 @@ public void WillNotSendEmailToOwnerThatOptsOut() | |
|
||
var messageService = TestableMessageService.Create(GetConfigurationService()); | ||
|
||
messageService.SendContactOwnersMessage(from, package, "Test message", "http://someurl/", false); | ||
messageService.SendContactOwnersMessage(from, package, "http://someurl/", "Test message", "http://someotherurl/", false); | ||
var message = messageService.MockMailSender.Sent.Last(); | ||
|
||
Assert.Equal("[email protected]", message.To[0].Address); | ||
|
@@ -290,7 +296,7 @@ public void WillNotAttemptToSendIfNoOwnersAllow() | |
}; | ||
|
||
var messageService = TestableMessageService.Create(GetConfigurationService()); | ||
messageService.SendContactOwnersMessage(from, package, "Test message", "http://someurl/", false); | ||
messageService.SendContactOwnersMessage(from, package, "http://someurl/", "Test message", "http://someotherurl/", false); | ||
|
||
Assert.Empty(messageService.MockMailSender.Sent); | ||
} | ||
|
@@ -307,7 +313,7 @@ public void WillNotCopySenderIfNoOwnersAllow() | |
}; | ||
|
||
var messageService = TestableMessageService.Create(GetConfigurationService()); | ||
messageService.SendContactOwnersMessage(from, package, "Test message", "http://someurl/", false); | ||
messageService.SendContactOwnersMessage(from, package, "http://someurl/", "Test message", "http://someotherurl/", false); | ||
|
||
Assert.Empty(messageService.MockMailSender.Sent); | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: may be format the parameters on new line?