Skip to content

Commit

Permalink
Support email threads (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLove-msft authored Jan 22, 2020
1 parent 2aaf7d1 commit 70da7ed
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class NotificationManager
private const string ENDPOINT_SETTING = "Endpoint";
private const string SENDGRID_KEY_SETTING = "SendGrid:Key";
private const string FROM_ADDRESS = "[email protected]";
private const string REPLY_TO_HEADER = "In-Reply-To";
private const string REFERENCES_HEADER = "References";

public NotificationManager(IConfiguration configuration, CosmosReviewRepository reviewRepository)
{
Expand Down Expand Up @@ -93,6 +95,9 @@ private async Task SendEmailsAsync(ReviewModel review, ClaimsPrincipal user, str
plainTextContent,
htmlContent,
Enumerable.Repeat(new Dictionary<string, string>(), review.Subscribers.Count).ToList());
var threadHeader = $"<{review.ReviewId}{FROM_ADDRESS}>";
msg.AddHeader(REPLY_TO_HEADER, threadHeader);
msg.AddHeader(REFERENCES_HEADER, threadHeader);
await client.SendEmailAsync(msg);
}

Expand Down

0 comments on commit 70da7ed

Please sign in to comment.