如何在 Azure API 管理中配置通知和电子邮件模板How to configure notifications and email templates in Azure API Management

API 管理提供的功能为特定事件配置通知,以及配置用于与 API 管理实例的管理员及开发人员通信的电子邮件模板。API Management provides the ability to configure notifications for specific events, and to configure the email templates that are used to communicate with the administrators and developers of an API Management instance. 本文演示如何为可用事件配置通知,并提供配置用于这些事件的电子邮件模板的概述。This article shows how to configure notifications for the available events, and provides an overview of configuring the email templates used for these events.

必备条件Prerequisites

如果没有 API 管理服务实例,请完成以下快速入门:创建一个 Azure API 管理实例If you do not have an API Management service instance, complete the following quickstart: Create an Azure API Management instance.

可用性Availability

重要

此功能在 API 管理的“高级”、“标准”、“基本”和“开发人员”层中可用。This feature is available in the Premium, Standard, Basic and Developer tiers of API Management.

配置通知 Configure notifications

  1. 选择 API 管理实例。Select your API MANAGEMENT instance.

  2. 单击“通知”即可查看可用的通知。Click Notifications to view the available notifications.

    发布者通知

    可为通知配置以下事件列表。The following list of events can be configured for notifications.

    • 订阅请求(需要批准) - 指定的电子邮件收件人和用户将收到关于需要批准的 API 产品的订阅请求的电子邮件通知。Subscription requests (requiring approval) - The specified email recipients and users will receive email notifications about subscription requests for API products requiring approval.

    • 新订阅 - 指定的电子邮件收件人和用户将收到关于新 API 产品订阅的电子邮件通知。New subscriptions - The specified email recipients and users will receive email notifications about new API product subscriptions.

    • 应用程序库请求 - 指定的电子邮件收件人和用户会在新的应用程序提交到应用程序库时收到电子邮件通知。Application gallery requests - The specified email recipients and users will receive email notifications when new applications are submitted to the application gallery.

    • BCC - 指定的电子邮件收件人和用户将收到发送给开发人员的所有电子邮件的电子邮件密件副本。BCC - The specified email recipients and users will receive email blind carbon copies of all emails sent to developers.

    • 新的问题或评论 - 在开发人员门户上提交新问题或评论时,指定的电子邮件收件人和用户将收到电子邮件通知。New issue or comment - The specified email recipients and users will receive email notifications when a new issue or comment is submitted on the developer portal.

    • 关闭帐户消息 - 指定的电子邮件收件人和用户会在关闭帐户时收到电子邮件通知。Close account message - The specified email recipients and users will receive email notifications when an account is closed.

    • 接近订阅配额限制 - 以下电子邮件收件人和用户会在订阅使用量接近使用量配额时收到电子邮件通知。Approaching subscription quota limit - The following email recipients and users will receive email notifications when subscription usage gets close to usage quota.

      备注

      通知仅由按订阅设置配额策略触发。Notifications are triggered by the quota by subscription policy only. 按密钥设置配额策略不会生成通知。Quota by key policy doesn't generate notifications.

    对于每个事件,可以指定电子邮件收件人(使用电子邮件地址文本框,或从列表中选择用户)。For each event, you can specify email recipients using the email address text box or you can select users from a list.

  3. 要指定被通知的电子邮件地址,请在电子邮件地址文本框中输入。To specify the email addresses to be notified, enter them in the email address text box. 如果有多个电子邮件地址,请使用逗号分隔。If you have multiple email addresses, separate them using commas.

    通知收件人

  4. 按“添加” 。Press Add.

配置通知模板 Configure notification templates

API 管理提供了在管理和使用服务的过程中发送的电子邮件的通知模板。API Management provides notification templates for the email messages that are sent in the course of administering and using the service. 提供以下电子邮件模板。The following email templates are provided.

  • 批准的应用程序库提交Application gallery submission approved
  • 开发人员告别字母Developer farewell letter
  • 开发人员配额限制接近通知Developer quota limit approaching notification
  • 邀请用户Invite user
  • 添加到问题的新注释New comment added to an issue
  • 接收到的新问题New issue received
  • 激活的新订阅New subscription activated
  • 订阅续订确认Subscription renewed confirmation
  • 订阅请求拒绝Subscription request declines
  • 接收的订阅请求Subscription request received

可按需修改这些模板。These templates can be modified as desired.

若要查看和配置 API 管理实例的电子邮件模板,请单击“通知模板” 。To view and configure the email templates for your API Management instance, click Notifications templates.

电子邮件模板

每个电子邮件模板都有纯文本格式的主题,和 HTML 格式的正文定义。Each email template has a subject in plain text, and a body definition in HTML format. 可按需自定义每一项。Each item can be customized as desired.

电子邮件模板编辑器

“参数” 列表包含参数列表,插入到主题或正文时,会在发送电子邮件时替换为指定的值。The Parameters list contains a list of parameters, which when inserted into the subject or body, will be replaced the designated value when the email is sent. 要插入一个参数,将光标置于要存放参数的位置,然后单击参数名称左侧的箭头。To insert a parameter, place the cursor where you wish the parameter to go, and click the arrow to the left of the parameter name.

备注

预览或发送测试时该参数不会替换为实际值。The parameters are not replaced with actual values when previewing or sending a test.

若要将更改保存到电子邮件模板,请单击“保存” ,或要取消更改时单击“放弃” 。To save the changes to the email template, click Save, or to cancel the changes click Discard.