Office.NotificationMessageAction interface   
通知消息的作定义。
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
              重要提示:在新式Outlook 网页版和新 Outlook on Windows 中,NotificationMessageAction对象仅在Compose模式下可用。
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml
// Adds an informational message with actions to the mail item.
const id = (document.getElementById("notificationId") as HTMLInputElement).value;
const itemId = Office.context.mailbox.item.itemId;
const details = {
  type: Office.MailboxEnums.ItemNotificationMessageType.InsightMessage,
  message: "This is an insight notification with id = " + id,
  icon: "PG.Icon.16",
  actions: [
    {
      actionText: "Open insight",
      actionType: Office.MailboxEnums.ActionType.ShowTaskPane,
      // Identify whether the current mail item is in read or compose mode to set the appropriate commandId value.
      commandId: (itemId == undefined ? "PG.HelpCommand.Compose" : "PG.HelpCommand.Read"),
      contextData: { a: "aValue", b: "bValue" }
    }
  ]
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details, handleResult);
属性
| action | 作链接的文本。 | 
| action | 要执行的作类型。 
               | 
| command | 清单中定义的按钮。 | 
| context | 作按钮需要传递给加载项的任何 JSON 数据。 | 
属性详细信息
		actionText
	 
	作链接的文本。
actionText: string;属性值
string
		actionType
	 
	要执行的作类型。 
              ActionType.ShowTaskPane 是唯一受支持的作。
actionType: string | MailboxEnums.ActionType;属性值
string | Office.MailboxEnums.ActionType
		commandId
	 
	清单中定义的按钮。
commandId: string;属性值
string
		contextData
	 
	作按钮需要传递给加载项的任何 JSON 数据。
contextData: any;属性值
any
注解
重要说明:
- 在 Outlook on Windows 中, - any从版本 2402 (内部版本 17308.20000) 开始支持该类型。 在早期版本的 Outlook on Windows 中,仅- string支持 类型。
- 若要检索 JSON 数据,请调用 - Office.context.mailboxitem.getInitializationContextAsync。 如果使用 创建 JSON 字符串- JSON.stringify()并将其分配给- contextData属性,则必须在检索该字符串后使用- JSON.parse()分析该字符串。
- 若要防止通知消息的任务窗格在已打开时重新启动,请实现 - Office.EventType.InitializationContextChanged事件的处理程序。 然后,可以将 事件参数 传递给- contextData属性。