feat: consume transactional email notifications
Add contract validation, SMTP delivery results, terminal failure context, neutral development seeding, and local Docker setup. Ref: IT-1033
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
namespace HrynCo.NotificationService.Worker.Services.EmailProcessing;
|
||||
|
||||
public static class RecipientAddressRedactor
|
||||
{
|
||||
public static string Redact(string? address)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(address))
|
||||
return "<missing>";
|
||||
|
||||
int separator = address.LastIndexOf('@');
|
||||
if (separator <= 0 || separator == address.Length - 1)
|
||||
return "***";
|
||||
|
||||
string local = address[..separator];
|
||||
string domain = address[(separator + 1)..];
|
||||
int dot = domain.LastIndexOf('.');
|
||||
string domainName = dot > 0 ? domain[..dot] : domain;
|
||||
string suffix = dot > 0 ? domain[dot..] : string.Empty;
|
||||
|
||||
return $"{local[0]}***@{domainName[0]}***{suffix}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user