feat(email): add delivery adapters
CI and Deploy / test (pull_request) Failing after 1m37s
CI and Deploy / deploy (pull_request) Has been skipped

Gmail and Graph request explicit send consent and classify provider rejection separately from uncertain transport failure. IMAP remains read-only; no send API is exposed.
This commit is contained in:
cesnimda
2026-08-09 23:47:21 +02:00
parent 429f427f49
commit e9937accd8
11 changed files with 331 additions and 9 deletions
@@ -23,9 +23,21 @@ namespace JobTrackerApi.Services.EmailProviders
/// <summary>Full message content (body + attachments metadata).</summary>
Task<EmailMessageDetail> GetMessageAsync(string ownerUserId, string messageId, CancellationToken cancellationToken);
Task<EmailDeliveryResult> SendAsync(string ownerUserId, EmailDeliveryRequest request, CancellationToken cancellationToken);
}
public sealed record EmailConnectionInfo(string ProviderKey, string Address);
public sealed record EmailConnectionInfo(string ProviderKey, string Address, bool CanSend = false);
public sealed record EmailDeliveryRequest(string To, string Subject, string BodyText, string? ThreadId = null);
public sealed record EmailDeliveryResult(string? ExternalMessageId, string? ExternalThreadId);
public sealed class EmailProviderDeliveryException(string category, bool uncertain, string message, Exception? innerException = null)
: Exception(message, innerException)
{
public string Category { get; } = category;
public bool Uncertain { get; } = uncertain;
}
public sealed record EmailMessageSummary(string Id, string ThreadId, string Subject, string From, string To, DateTimeOffset? Date, string Snippet);