An entity schema for a draft.
To make your app's content available to Apple Intelligence,
conform your ``AppEntity`` to a schema that describes your content to the system.
If your app's functionality aligns with the `mail` domain
and its content matches the `draft` schema,
you can generate the properties and protocol conformance the schema requires
for your app entity implementation
with the `@AppEntity( .mail.draft)` Swift macro.
To make your app work with Siri,
see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>.
The following example shows an app entity that conforms to the `draft` schema:
```swift
@AppEntity(schema: .mail.draft)
struct MailDraftEntity {
// MARK: Static
static let defaultQuery = MailDraftEntityQuery()
// MARK: Properties
let id: <#Identifiable.ID#>
var to: [IntentPerson]
var cc: [IntentPerson]
var bcc: [IntentPerson]
var subject: String?
var body: AttributedString?
var attachments: [IntentFile]
var account: <#MailAccountEntity#>
var displayRepresentation: DisplayRepresentation {
<#DisplayRepresentation#>
}
// MARK: Query
struct MailDraftEntityQuery: EntityQuery {
func entities(for identifiers: [MailDraftEntity.ID]) async throws -> [MailDraftEntity] {
<#code#>
}
}
}
```
The schema supports the following system experiences:
- Siri
- Shortcuts
For more information about the App Intents framework and the experiences it supports,
see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.
get · iOS 27.0+
thread
Swift declaration
var thread: some AppSchemaEntity { get }
An entity schema for a thread.
To make your app's content available to Apple Intelligence,
conform your ``AppEntity`` to a schema that describes your content to the system.
If your app's functionality aligns with the `mail` domain
and its content matches the `thread` schema,
you can generate the properties and protocol conformance the schema requires
for your app entity implementation
with the `@AppEntity( .mail.thread)` Swift macro.
To make your app work with Siri,
see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>.
The following example shows an app entity that conforms to the `thread` schema:
```swift
@AppEntity(schema: .mail.thread)
struct MailThreadEntity {
// MARK: Static
static let defaultQuery = MailThreadEntityQuery()
// MARK: Properties
let id: <#Identifiable.ID#>
var title: String
var description: String?
var messages: [<#MailMessageEntity#>]
var displayRepresentation: DisplayRepresentation {
<#DisplayRepresentation#>
}
// MARK: Query
struct MailThreadEntityQuery: EntityQuery {
func entities(for identifiers: [MailThreadEntity.ID]) async throws -> [MailThreadEntity] {
<#code#>
}
}
}
```
The schema supports the following system experiences:
- Siri
- Shortcuts
For more information about the App Intents framework and the experiences it supports,
see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.
get · iOS 18.0+
account
Swift declaration
var account: some AppSchemaEntity { get }
An entity schema for an account.
To make your app's content available to Apple Intelligence,
conform your ``AppEntity`` to a schema that describes your content to the system.
If your app's functionality aligns with the `mail` domain
and its content matches the `account` schema,
you can generate the properties and protocol conformance the schema requires
for your app entity implementation
with the `@AppEntity( .mail.account)` Swift macro.
To make your app work with Siri,
see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>.
The following example shows an app entity that conforms to the `account` schema:
```swift
@AppEntity(schema: .mail.account)
struct MailAccountEntity {
// MARK: Static
static let defaultQuery = MailAccountEntityQuery()
// MARK: Properties
let id: <#Identifiable.ID#>
var name: String
var emailAddress: String
var displayRepresentation: DisplayRepresentation {
<#DisplayRepresentation#>
}
// MARK: Query
struct MailAccountEntityQuery: EntityQuery {
func entities(for identifiers: [MailAccountEntity.ID]) async throws -> [MailAccountEntity] {
<#code#>
}
}
}
```
The schema supports the following system experiences:
- Siri
- Shortcuts
For more information about the App Intents framework and the experiences it supports,
see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.
get · iOS 18.0+
mailbox
Swift declaration
var mailbox: some AppSchemaEntity { get }
An entity schema for a mailbox.
To make your app's content available to Apple Intelligence,
conform your ``AppEntity`` to a schema that describes your content to the system.
If your app's functionality aligns with the `mail` domain
and its content matches the `mailbox` schema,
you can generate the properties and protocol conformance the schema requires
for your app entity implementation
with the `@AppEntity( .mail.mailbox)` Swift macro.
To make your app work with Siri,
see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>.
The following example shows an app entity that conforms to the `mailbox` schema:
```swift
@AppEntity(schema: .mail.mailbox)
struct MailboxEntity {
// MARK: Static
static let defaultQuery = MailboxEntityQuery()
// MARK: Properties
let id: <#Identifiable.ID#>
var name: String
var account: <#MailAccountEntity#>
var displayRepresentation: DisplayRepresentation {
<#DisplayRepresentation#>
}
// MARK: Query
struct MailboxEntityQuery: EntityQuery {
func entities(for identifiers: [MailboxEntity.ID]) async throws -> [MailboxEntity] {
<#code#>
}
}
}
```
The schema supports the following system experiences:
- Siri
- Shortcuts
For more information about the App Intents framework and the experiences it supports,
see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.
get · iOS 18.0+
message
Swift declaration
var message: some AppSchemaEntity { get }
An entity schema for a message.
To make your app's content available to Apple Intelligence,
conform your ``AppEntity`` to a schema that describes your content to the system.
If your app's functionality aligns with the `mail` domain
and its content matches the `message` schema,
you can generate the properties and protocol conformance the schema requires
for your app entity implementation
with the `@AppEntity( .mail.message)` Swift macro.
To make your app work with Siri,
see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>.
The following example shows an app entity that conforms to the `message` schema:
```swift
@AppEntity(schema: .mail.message)
struct MailMessageEntity {
// MARK: Static
static let defaultQuery = MailMessageEntityQuery()
// MARK: Properties
let id: <#Identifiable.ID#>
var to: [IntentPerson]
var cc: [IntentPerson]
var bcc: [IntentPerson]
var subject: String?
var body: AttributedString?
var attachments: [IntentFile]
var sender: IntentPerson
var dateSent: Date
var dateReceived: Date
var isRead: Bool
var isJunk: Bool
var isFlagged: Bool
var category: <#MailCategory#>?
var account: <#MailAccountEntity#>
var mailbox: <#MailboxEntity#>
var displayRepresentation: DisplayRepresentation {
<#DisplayRepresentation#>
}
// MARK: Query
struct MailMessageEntityQuery: EntityQuery {
func entities(for identifiers: [MailMessageEntity.ID]) async throws -> [MailMessageEntity] {
<#code#>
}
}
}
```
The schema supports the following system experiences:
- Siri
- Shortcuts
For more information about the App Intents framework and the experiences it supports,
see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.