Gmail manifest resource

The resource configuration that is used to define Google Workspace Add-on content and behavior within Gmail. Google Workspace Add-on manifests must have all the components marked as Required if they extend Gmail.

Gmail

The Google Workspace Add-on manifest configuration for Gmail extensions. See Extending Gmail with Google Workspace Add-ons for more information.

JSON representation
{
  "authorizationCheckFunction": string,
  "composeTrigger": {
    object (ComposeTrigger)
  },
  "contextualTriggers": [
    {
      object (ContextualTrigger)
    }
  ],
  "homepageTrigger": {
    object (HomepageTrigger)
  }
}
Fields
authorizationCheckFunction

string

Deprecated. The name of an Apps Script function that performs third-party authorization requirement checks. This function is called before each invocation of the Google Workspace Add-on.

This function was deprecated to avoid unnecessary execution latency. Instead, the add-on should throw an exception from the main invocation, as shown in this example.

composeTrigger

object (ComposeTrigger)

Required for compose actions. Defines the set of UIs available to the user while composing an email.

See Extending the compose UI with compose actions for details.

contextualTriggers[]

object (ContextualTrigger)

Required. A list of triggers that fire when a message is opened in Gmail. When the trigger fires, it executes a specific Apps Script function, usually to create new cards and update the UI.
homepageTrigger

object (HomepageTrigger)

The trigger function specification for creating the add-on homepage in the Gmail host. This overrides addOns.common.homepageTrigger.

ComposeTrigger

The configuration for a compose action. See Extending the Compose UI for more information.

JSON representation
{
  "draftAccess": string,
  "selectActions": [
    {
      object (SelectAction)
    }
  ]
}
Fields
draftAccess

string

Defines the level of data access available to a compose trigger function. Valid options are the following:

  • NONE, the default setting. This causes the event object passed to the compose trigger function to be mostly empty.
  • METADATA, which populates the event object passed to the compose trigger function with lists of recipients of the message. This setting requires that the add-on include the gmail.addons.current.message.metadata scope.
selectActions[]

object (SelectAction)

A list of compose actions that create compose UIs; however, this list is limited to a single action per add-on. The compose action has a corresponding icon presented in the Gmail compose window. The icon is specified by gmail.logoUrl.

ContextualTrigger

The configuration for a trigger that fires when the user opens a Gmail message and that message satisfies certain criteria. See Extending the message UI for more information.

JSON representation
{
  "onTriggerFunction": string,
  "unconditional": {},
}
Fields
onTriggerFunction

string

Required for each contextual trigger. The name of the Apps Script function that executes when the trigger fires.

See Contextual trigger function for details on how to define this function.

unconditional

object

Required for each contextual trigger. Used to specify that the contextual trigger activates for all Gmail messages when they are opened. This is currently the only option, so this should always be an empty object.

SelectAction

The compose action configuration that defines which function to run when the user selects the compose action.

JSON representation
{
  "runFunction": string,
  "text": string
}
Fields
runFunction

string

Required for compose actions. The name of the Apps Script function that executes when this compose action is selected. This compose trigger function builds the add-on compose UI.

See Compose trigger function for details.

text

string

Required for compose actions. A short text description of this compose action.