Reference documentation and code samples for the Google Workspace Add-ons V1 API class Google::Apps::Script::Type::Gmail::ContextualTrigger.
Defines a trigger that fires when the open email meets a specific criteria.
When the trigger fires, it executes a specific endpoint, usually
in order to create new cards and update the UI.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#on_trigger_function
defon_trigger_function()->::String
Returns
(::String) — Required. The name of the endpoint to call when a message matches the
trigger.
#on_trigger_function=
defon_trigger_function=(value)->::String
Parameter
value (::String) — Required. The name of the endpoint to call when a message matches the
trigger.
Returns
(::String) — Required. The name of the endpoint to call when a message matches the
trigger.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Google Workspace Add-ons V1 API - Class Google::Apps::Script::Type::Gmail::ContextualTrigger (v1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/latest/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [1.2.1](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/1.2.1/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [1.1.0](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/1.1.0/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [1.0.1](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/1.0.1/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [0.6.0](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/0.6.0/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [0.5.2](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/0.5.2/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [0.4.0](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/0.4.0/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [0.3.0](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/0.3.0/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [0.2.0](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/0.2.0/Google-Apps-Script-Type-Gmail-ContextualTrigger)\n- [0.1.0](/ruby/docs/reference/google-cloud-gsuite_add_ons-v1/0.1.0/Google-Apps-Script-Type-Gmail-ContextualTrigger) \nReference documentation and code samples for the Google Workspace Add-ons V1 API class Google::Apps::Script::Type::Gmail::ContextualTrigger.\n\nDefines a trigger that fires when the open email meets a specific criteria.\nWhen the trigger fires, it executes a specific endpoint, usually\nin order to create new cards and update the UI. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #on_trigger_function\n\n def on_trigger_function() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. The name of the endpoint to call when a message matches the trigger.\n\n### #on_trigger_function=\n\n def on_trigger_function=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. The name of the endpoint to call when a message matches the trigger. \n**Returns**\n\n- (::String) --- Required. The name of the endpoint to call when a message matches the trigger.\n\n### #unconditional\n\n def unconditional() -\u003e ::Google::Apps::Script::Type::Gmail::UnconditionalTrigger\n\n**Returns**\n\n- ([::Google::Apps::Script::Type::Gmail::UnconditionalTrigger](./Google-Apps-Script-Type-Gmail-UnconditionalTrigger)) --- UnconditionalTriggers are executed when any mail message is opened.\n\n### #unconditional=\n\n def unconditional=(value) -\u003e ::Google::Apps::Script::Type::Gmail::UnconditionalTrigger\n\n**Parameter**\n\n- **value** ([::Google::Apps::Script::Type::Gmail::UnconditionalTrigger](./Google-Apps-Script-Type-Gmail-UnconditionalTrigger)) --- UnconditionalTriggers are executed when any mail message is opened. \n**Returns**\n\n- ([::Google::Apps::Script::Type::Gmail::UnconditionalTrigger](./Google-Apps-Script-Type-Gmail-UnconditionalTrigger)) --- UnconditionalTriggers are executed when any mail message is opened."]]