add OutgoingAttachment model, attachments field on OutgoingMessage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 11:26:03 +01:00
parent 1c9e36a970
commit 1b4556b167

View File

@@ -1,3 +1,17 @@
import Foundation
public struct OutgoingAttachment: Sendable, Codable, Equatable {
public var filename: String
public var mimeType: String
public var data: Data
public init(filename: String, mimeType: String, data: Data) {
self.filename = filename
self.mimeType = mimeType
self.data = data
}
}
public struct OutgoingMessage: Sendable, Codable, Equatable {
public var from: EmailAddress
public var to: [EmailAddress]
@@ -8,6 +22,7 @@ public struct OutgoingMessage: Sendable, Codable, Equatable {
public var inReplyTo: String?
public var references: String?
public var messageId: String
public var attachments: [OutgoingAttachment]
public init(
from: EmailAddress,
@@ -18,7 +33,8 @@ public struct OutgoingMessage: Sendable, Codable, Equatable {
bodyText: String,
inReplyTo: String? = nil,
references: String? = nil,
messageId: String
messageId: String,
attachments: [OutgoingAttachment] = []
) {
self.from = from
self.to = to
@@ -29,5 +45,6 @@ public struct OutgoingMessage: Sendable, Codable, Equatable {
self.inReplyTo = inReplyTo
self.references = references
self.messageId = messageId
self.attachments = attachments
}
}