public sealed class ContextualTrigger : IMessage<ContextualTrigger>, IEquatable<ContextualTrigger>, IDeepCloneable<ContextualTrigger>, IBufferMessage, IMessage
Reference documentation and code samples for the Google.Apps.Script.Type class 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.
[[["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 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eContextualTrigger\u003c/code\u003e class in the \u003ccode\u003eGoogle.Apps.Script.Type\u003c/code\u003e namespace defines a trigger that activates when an email meets specific criteria, typically to update the UI.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements multiple interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing various functionalities for message handling and object comparison.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eContextualTrigger\u003c/code\u003e has two constructors, a default one and one that takes another \u003ccode\u003eContextualTrigger\u003c/code\u003e object for cloning.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eContextualTrigger\u003c/code\u003e include \u003ccode\u003eOnTriggerFunction\u003c/code\u003e, which specifies the endpoint to call, \u003ccode\u003eTriggerCase\u003c/code\u003e, which determines the type of trigger, and \u003ccode\u003eUnconditional\u003c/code\u003e, for triggers that fire with any opened email.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this class is \u003ccode\u003e2.3.0\u003c/code\u003e, with previous versions ranging from \u003ccode\u003e1.0.0\u003c/code\u003e to \u003ccode\u003e2.2.0\u003c/code\u003e also being documented.\u003c/p\u003e\n"]]],[],null,["# Google.Apps.Script.Type - Class ContextualTrigger (2.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.0 (latest)](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.ContextualTrigger)\n- [2.2.0](/dotnet/docs/reference/Google.Apps.Script.Type/2.2.0/Google.Apps.Script.Type.Gmail.ContextualTrigger)\n- [2.1.0](/dotnet/docs/reference/Google.Apps.Script.Type/2.1.0/Google.Apps.Script.Type.Gmail.ContextualTrigger)\n- [2.0.0](/dotnet/docs/reference/Google.Apps.Script.Type/2.0.0/Google.Apps.Script.Type.Gmail.ContextualTrigger)\n- [1.1.0](/dotnet/docs/reference/Google.Apps.Script.Type/1.1.0/Google.Apps.Script.Type.Gmail.ContextualTrigger)\n- [1.0.0](/dotnet/docs/reference/Google.Apps.Script.Type/1.0.0/Google.Apps.Script.Type.Gmail.ContextualTrigger) \n\n public sealed class ContextualTrigger : IMessage\u003cContextualTrigger\u003e, IEquatable\u003cContextualTrigger\u003e, IDeepCloneable\u003cContextualTrigger\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google.Apps.Script.Type class 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\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ContextualTrigger \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ContextualTrigger](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.ContextualTrigger), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ContextualTrigger](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.ContextualTrigger), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ContextualTrigger](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail.ContextualTrigger), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Apps.Script.Type.Gmail](/dotnet/docs/reference/Google.Apps.Script.Type/latest/Google.Apps.Script.Type.Gmail)\n\nAssembly\n--------\n\nGoogle.Apps.Script.Type.dll\n\nConstructors\n------------\n\n### ContextualTrigger()\n\n public ContextualTrigger()\n\n### ContextualTrigger(ContextualTrigger)\n\n public ContextualTrigger(ContextualTrigger other)\n\nProperties\n----------\n\n### OnTriggerFunction\n\n public string OnTriggerFunction { get; set; }\n\nRequired. The name of the endpoint to call when a message matches the\ntrigger.\n\n### TriggerCase\n\n public ContextualTrigger.TriggerOneofCase TriggerCase { get; }\n\n### Unconditional\n\n public UnconditionalTrigger Unconditional { get; set; }\n\nUnconditionalTriggers are executed when any mail message is opened."]]