Skip to content

Commit

Permalink
Style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
montyclt committed Sep 12, 2024
1 parent 4c3e829 commit 1e72cca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Foundation/Emailing/MessageId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public MessageId(string value)
/// <exception cref="ArgumentException">Thrown when the provided domain is not a valid domain format.</exception>
public static MessageId GenerateMessageId(string domain)
{
//Ensure.Argument(nameof(domain)).String.Domain(domain);
// Ensure.String.Domain(domain).ElseThrowsIllegalArgument("Invalid domain format.", nameof(domain));

var timestamp = DateTime.UtcNow.ToString("yyyyMMddHHmmssffff");
var randomValue = new Random().Next(100000, 999999);
Expand All @@ -53,6 +53,9 @@ public static MessageId GenerateMessageId(string domain)
/// <returns>true if the provided string is a valid Message-ID format; otherwise, false.</returns>
public static bool IsValidMessageId(string messageId)
{
// Regex generated by GitHub Copilot. Not sure if it's correct.
// "^<\d{14}-\d{6}@[\w\.]+>$"

if (string.IsNullOrWhiteSpace(messageId))
{
return false;
Expand Down

0 comments on commit 1e72cca

Please sign in to comment.