feat(email): add delivery adapters
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user