Assistant schema conformance for app intents that offer email functionality.
Members (10)
get · iOS 16.0+
replyMail
Swift declaration
var replyMail: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for replying to an email message.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.replyMail` schema:
```swift
@AppIntent(schema: .mail.replyMail)
struct ReplyMailIntent: AppIntent {
@Parameter
var to: [IntentPerson]
@Parameter
var cc: [IntentPerson]
@Parameter
var bcc: [IntentPerson]
@Parameter
var subject: String?
@Parameter
var body: AttributedString?
@Parameter
var account: MailAccountEntity?
@Parameter
var attachments: [IntentFile]
@Parameter
var isReplyAll: Bool
@Parameter
var target: MailMessageEntity
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
deleteMail
Swift declaration
var deleteMail: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for deleting email messages.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.deleteMail` schema:
```swift
@AppIntent(schema: .mail.deleteMail)
struct DeleteMailIntent: DeleteIntent {
@Parameter
var entities: [MailMessageEntity]
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
updateMail
Swift declaration
var updateMail: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for updating email messages.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.updateMail` schema:
```swift
@AppIntent(schema: .mail.updateMail)
struct UpdateMailIntent: AppIntent {
@Parameter
var target: [MailMessageEntity]
@Parameter
var isRead: Bool?
@Parameter
var isFlagged: Bool?
@Parameter
var isJunk: Bool?
@Parameter
var mailbox: MailboxEntity?
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
archiveMail
Swift declaration
var archiveMail: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for archiving an email message.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.archiveMail` schema:
```swift
@AppIntent(schema: .mail.archiveMail)
struct ArchiveMailIntent: AppIntent {
@Parameter
var entities: [MailMessageEntity]
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
forwardMail
Swift declaration
var forwardMail: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for forwarding an email message.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.forwardMail` schema:
```swift
@AppIntent(schema: .mail.forwardMail)
struct ForwardMailIntent: AppIntent {
@Parameter
var to: [IntentPerson]
@Parameter
var cc: [IntentPerson]
@Parameter
var bcc: [IntentPerson]
@Parameter
var subject: String?
@Parameter
var body: AttributedString?
@Parameter
var account: MailAccountEntity?
@Parameter
var attachments: [IntentFile]
@Parameter
var target: MailMessageEntity
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
createDraft
Swift declaration
var createDraft: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for creating an email draft.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.createDraft` schema:
```swift
@AppIntent(schema: .mail.createDraft)
struct CreateDraftIntent: AppIntent {
@Parameter
var to: [IntentPerson]
@Parameter
var cc: [IntentPerson]
@Parameter
var bcc: [IntentPerson]
@Parameter
var subject: String?
@Parameter
var body: AttributedString?
@Parameter
var account: MailAccountEntity?
@Parameter(default: [])
var attachments: [IntentFile]
func perform() async throws -> some ReturnsValue<MailDraftEntity> {
.result(value: MailDraftEntity())
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
deleteDraft
Swift declaration
var deleteDraft: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for deleting an email draft.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.deleteDraft` schema:
```swift
@AppIntent(schema: .mail.deleteDraft)
struct DeleteDraftIntent: DeleteIntent {
@Parameter
var entities: [MailMessageEntity]
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
updateDraft
Swift declaration
var updateDraft: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for updating an email draft.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.updateDraft` schema:
```swift
@AppIntent(schema: .mail.updateDraft)
struct UpdateDraftIntent: AppIntent {
@Parameter
var target: MailDraftEntity
@Parameter
var to: [IntentPerson]?
@Parameter
var cc: [IntentPerson]?
@Parameter
var bcc: [IntentPerson]?
@Parameter
var subject: String?
@Parameter
var body: AttributedString?
@Parameter
var account: MailAccountEntity?
@Parameter
var attachments: [IntentFile]?
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
saveDraft
Swift declaration
var saveDraft: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for saving an email draft.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.saveDraft` schema:
```swift
@AppIntent(schema: .mail.saveDraft)
struct SaveDraftIntent: AppIntent {
@Parameter var target: MailDraftEntity
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.
get · iOS 16.0+
sendDraft
Swift declaration
var sendDraft: some AssistantSchemas.Intent { get }
The app intent conforms to the schema for sending an email draft.
## Overview
Use Swift macros that generate additional properties and add protocol conformance
for your app intent implementation. The following example shows an app intent that conforms to the `.mail.sendDraft` schema:
```swift
@AppIntent(schema: .mail.sendDraft)
struct SendDraftIntent: AppIntent {
@Parameter
var target: MailDraftEntity
@Parameter
var sendLaterDate: Date?
func perform() async throws -> some IntentResult {
.result()
}
}
```
For more information about the `.mail` app intent domain,
see <doc:app-schema-domain-mail>.
For general information about app intent domains, see <doc:making-actions-and-content-discoverable-by-apple-intelligence>.