One Logo Pool Ball
AppIntents · IOS API REFERENCE

AppSchema.MailIntent

protocol · iOS 18.0+ · SDK 27.1

protocol MailIntent : AppSchema.Kind

Identifies intent schemas in the mail domain.

Members (12)

get · iOS 18.0+

replyMail

Swift declaration
var replyMail: some AppSchemaIntent { get }

An intent schema that opens an email composer to reply to an email. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `replyMail` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.replyMail)` 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 intent that conforms to the `replyMail` schema: ```swift @AppIntent(schema: .mail.replyMail) struct ReplyMailIntent { var isReplyAll: Bool var target: <#MailMessageEntity#> var body: AttributedString? var subject: String? var account: <#MailAccountEntity#>? var attachments: [IntentFile] var to: [IntentPerson] var cc: [IntentPerson] var bcc: [IntentPerson] func perform() async throws -> some IntentResult { <#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+

deleteMail

Swift declaration
var deleteMail: some AppSchemaIntent { get }

An intent schema that deletes one or more email messages. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `deleteMail` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.deleteMail)` 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 intent that conforms to the `deleteMail` schema: ```swift @AppIntent(schema: .mail.deleteMail) struct DeleteMailIntent: DeleteIntent { var entities: [<#MailMessageEntity#>] func perform() async throws -> some IntentResult { <#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+

updateMail

Swift declaration
var updateMail: some AppSchemaIntent { get }

An intent schema that makes updates to one or more existing email messages by modifying the status, flags, and location. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `updateMail` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.updateMail)` 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 intent that conforms to the `updateMail` schema: ```swift @AppIntent(schema: .mail.updateMail) struct UpdateMailIntent { var target: [<#MailMessageEntity#>] var isRead: Bool? var isFlagged: Bool? var isJunk: Bool? var mailbox: <#MailboxEntity#>? func perform() async throws -> some IntentResult { <#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+

archiveMail

Swift declaration
var archiveMail: some AppSchemaIntent { get }

An intent schema that archives one or more email messages. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `archiveMail` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.archiveMail)` 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 intent that conforms to the `archiveMail` schema: ```swift @AppIntent(schema: .mail.archiveMail) struct ArchiveMailIntent { var entities: [<#MailMessageEntity#>] func perform() async throws -> some IntentResult { <#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+

forwardMail

Swift declaration
var forwardMail: some AppSchemaIntent { get }

An intent schema that opens an email composer to forward an email. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `forwardMail` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.forwardMail)` 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 intent that conforms to the `forwardMail` schema: ```swift @AppIntent(schema: .mail.forwardMail) struct ForwardMailIntent { var target: <#MailMessageEntity#> var to: [IntentPerson] var body: AttributedString? var cc: [IntentPerson] var bcc: [IntentPerson] var subject: String? var account: <#MailAccountEntity#>? var attachments: [IntentFile] func perform() async throws -> some IntentResult { <#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+

createDraft

Swift declaration
var createDraft: some AppSchemaIntent { get }

An intent schema that opens an email composer to draft an email. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `createDraft` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.createDraft)` 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 intent that conforms to the `createDraft` schema: ```swift @AppIntent(schema: .mail.createDraft) struct CreateDraftIntent { var body: AttributedString? var to: [IntentPerson] var subject: String? var cc: [IntentPerson] var bcc: [IntentPerson] var account: <#MailAccountEntity#>? var attachments: [IntentFile] func perform() async throws -> some ReturnsValue<<#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 18.0+

deleteDraft

Swift declaration
var deleteDraft: some AppSchemaIntent { get }

An intent schema that deletes one or more email drafts. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `deleteDraft` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.deleteDraft)` 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 intent that conforms to the `deleteDraft` schema: ```swift @AppIntent(schema: .mail.deleteDraft) struct DeleteDraftIntent: DeleteIntent { var entities: [<#MailDraftEntity#>] func perform() async throws -> some IntentResult { <#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+

openMessage

Swift declaration
var openMessage: some AppSchemaIntent { get }

An intent schema that opens an email message. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `openMessage` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.openMessage)` 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 intent that conforms to the `openMessage` schema: ```swift @AppIntent(schema: .mail.openMessage) struct MailOpenMessage: OpenIntent { var target: <#MailMessageEntity#> func perform() async throws -> some IntentResult { <#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+

updateDraft

Swift declaration
var updateDraft: some AppSchemaIntent { get }

An intent schema that makes updates to an email draft. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `updateDraft` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.updateDraft)` 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 intent that conforms to the `updateDraft` schema: ```swift @AppIntent(schema: .mail.updateDraft) struct UpdateDraftIntent { var target: <#MailDraftEntity#> var to: [IntentPerson]? var cc: [IntentPerson]? var bcc: [IntentPerson]? var subject: String? var body: AttributedString? var account: <#MailAccountEntity#>? var attachments: [IntentFile]? func perform() async throws -> some IntentResult { <#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+

openDraft

Swift declaration
var openDraft: some AppSchemaIntent { get }

An intent schema that opens an email draft. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `openDraft` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.openDraft)` 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 intent that conforms to the `openDraft` schema: ```swift @AppIntent(schema: .mail.openDraft) struct MailOpenDraft: OpenIntent { var target: <#MailDraftEntity#> func perform() async throws -> some IntentResult { <#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+

saveDraft

Swift declaration
var saveDraft: some AppSchemaIntent { get }

An intent schema that saves an email draft. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `saveDraft` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.saveDraft)` 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 intent that conforms to the `saveDraft` schema: ```swift @AppIntent(schema: .mail.saveDraft) struct SaveDraftIntent { var target: <#MailDraftEntity#> func perform() async throws -> some IntentResult { <#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+

sendDraft

Swift declaration
var sendDraft: some AppSchemaIntent { get }

An intent schema that sends an email draft or schedules it to be sent later. To make your app's actions available to Apple Intelligence, conform your ``AppIntent`` to a schema that describes your action to the system. If your app's functionality aligns with the `mail` domain and one of your app's actions matches the `sendDraft` schema, you can generate the properties and protocol conformance the schema requires for your intent implementation with the `@AppIntent( .mail.sendDraft)` 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 intent that conforms to the `sendDraft` schema: ```swift @AppIntent(schema: .mail.sendDraft) struct SendDraftIntent { var target: <#MailDraftEntity#> var sendLaterDate: Date? func perform() async throws -> some IntentResult { <#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>.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →