[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["\u003cp\u003eComposeActionResponseBuilder helps create responses for actions that generate draft emails when a UI element is interacted with.\u003c/p\u003e\n"],["\u003cp\u003eIt's important to understand that this is distinct from compose actions used to extend the Gmail compose UI.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this builder to set a Gmail draft created using methods like GmailMessage.createDraftReply().\u003c/p\u003e\n"],["\u003cp\u003eThe build() method finalizes the response and ensures it's valid before use.\u003c/p\u003e\n"]]],["The `ComposeActionResponseBuilder` creates responses to actions that compose draft messages. It has two key methods: `build()` and `setGmailDraft(draft)`. `build()` constructs and validates the `ComposeActionResponse`. If it is invalid an error is thrown. `setGmailDraft(draft)` sets the `GmailDraft` using functions such as `GmailMessage.createDraftReply(body)`, allowing for modification of the draft before composing. The builder itself is not directly related to compose actions but creates responses when UI elements are selected.\n"],null,["ComposeActionResponseBuilder\n\nA builder for [ComposeActionResponse](/apps-script/reference/card-service/compose-action-response) objects.\n\n\n| **Note** : This object isn't related to **compose actions** that are used to [extend the compose UI](/gmail/add-ons/how-tos/extending-compose-ui). Rather, this builder creates responses to an [Action](/apps-script/reference/card-service/action) that composes draft messages when a specific UI element is selected.\n\n\u003cbr /\u003e\n\nMethods\n\n| Method | Return type | Brief description |\n|----------------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [build()](#build()) | [ComposeActionResponse](/apps-script/reference/card-service/compose-action-response) | Builds the current compose action response and validates it. |\n| [setGmailDraft(draft)](#setGmailDraft(GmailDraft)) | [ComposeActionResponseBuilder](#) | Sets the draft [GmailMessage](../gmail/gmail-message.html) created using [GmailMessage.createDraftReply(body)](../gmail/gmail-message.html#createDraftReply(String)) or similar functions. |\n\nDetailed documentation \n\n`build()` \nBuilds the current compose action response and validates it.\n\nReturn\n\n\n[ComposeActionResponse](/apps-script/reference/card-service/compose-action-response) --- A validated [ComposeActionResponse](/apps-script/reference/card-service/compose-action-response).\n\nThrows\n\n\n[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) --- if the constructed compose action response isn't valid.\n\n*** ** * ** ***\n\n`set``Gmail``Draft(draft)` \nSets the draft [GmailMessage](../gmail/gmail-message.html) created\nusing [GmailMessage.createDraftReply(body)](../gmail/gmail-message.html#createDraftReply(String)) or\nsimilar functions.\n\nParameters\n\n| Name | Type | Description |\n|---------|-----------------------------------------|-----------------------------------------------------|\n| `draft` | [GmailDraft](../gmail/gmail-draft.html) | The [GmailDraft](../gmail/gmail-draft.html) to use. |\n\nReturn\n\n\n[ComposeActionResponseBuilder](#) --- This object, for chaining."]]