你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Email Template - Create Or Update

汇报Email模板。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}?api-version=2022-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

serviceName
path True

string

API 管理服务的名称。

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

目标订阅的 ID。

templateName
path True

TemplateName

Email模板名称标识符。

api-version
query True

string

要用于此操作的 API 版本。

请求头

名称 必需 类型 说明
If-Match

string

实体的 ETag。 创建实体时不需要,但在更新实体时是必需的。

请求正文

名称 类型 说明
properties.body

string

Email模板正文。 这应该是有效的 XDocument

properties.description

string

Email模板的说明。

properties.parameters

EmailTemplateParametersContractProperties[]

Email模板参数值。

properties.subject

string

模板的主题。

properties.title

string

模板的标题。

响应

名称 类型 说明
200 OK

EmailTemplateContract

已成功更新Email模板。

201 Created

EmailTemplateContract

已成功更新Email模板。

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ApiManagementCreateTemplate

Sample Request

PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/newIssueNotificationMessage?api-version=2022-08-01

{
  "properties": {
    "subject": "Your request for $IssueName was successfully received."
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/NewIssueNotificationMessage",
  "type": "Microsoft.ApiManagement/service/templates",
  "name": "NewIssueNotificationMessage",
  "properties": {
    "subject": "Your request for $IssueName was successfully received.",
    "body": "<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Thank you for contacting us. Our API team will review your issue and get back to you soon.</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          Click this <a href=\"http://$DevPortalUrl/issues/$IssueId\">link</a> to view or edit your request.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>",
    "title": "New issue received",
    "description": "This email is sent to developers after they create a new topic on the Issues page of the developer portal.",
    "isDefault": false,
    "parameters": [
      {
        "name": "DevFirstName",
        "title": "Developer first name"
      },
      {
        "name": "DevLastName",
        "title": "Developer last name"
      },
      {
        "name": "IssueId",
        "title": "Issue id"
      },
      {
        "name": "IssueName",
        "title": "Issue name"
      },
      {
        "name": "OrganizationName",
        "title": "Organization name"
      },
      {
        "name": "DevPortalUrl",
        "title": "Developer portal URL"
      }
    ]
  }
}
{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/templates/NewIssueNotificationMessage",
  "type": "Microsoft.ApiManagement/service/templates",
  "name": "NewIssueNotificationMessage",
  "properties": {
    "subject": "Your request for $IssueName was successfully received.",
    "body": "<!DOCTYPE html >\r\n<html>\r\n  <head />\r\n  <body>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Dear $DevFirstName $DevLastName,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Thank you for contacting us. Our API team will review your issue and get back to you soon.</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">\r\n          Click this <a href=\"http://$DevPortalUrl/issues/$IssueId\">link</a> to view or edit your request.\r\n        </p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">Best,</p>\r\n    <p style=\"font-size:12pt;font-family:'Segoe UI'\">The $OrganizationName API Team</p>\r\n  </body>\r\n</html>",
    "title": "New issue received",
    "description": "This email is sent to developers after they create a new topic on the Issues page of the developer portal.",
    "isDefault": false,
    "parameters": [
      {
        "name": "DevFirstName",
        "title": "Developer first name"
      },
      {
        "name": "DevLastName",
        "title": "Developer last name"
      },
      {
        "name": "IssueId",
        "title": "Issue id"
      },
      {
        "name": "IssueName",
        "title": "Issue name"
      },
      {
        "name": "OrganizationName",
        "title": "Organization name"
      },
      {
        "name": "DevPortalUrl",
        "title": "Developer portal URL"
      }
    ]
  }
}

定义

名称 说明
EmailTemplateContract

Email模板详细信息。

EmailTemplateParametersContractProperties

Email模板参数协定。

EmailTemplateUpdateParameters

Email模板更新参数。

ErrorFieldContract

错误字段协定。

ErrorResponse

错误响应。

TemplateName

Email模板名称标识符。

EmailTemplateContract

Email模板详细信息。

名称 类型 说明
id

string

资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

资源的名称

properties.body

string

Email模板正文。 这应该是有效的 XDocument

properties.description

string

Email模板的说明。

properties.isDefault

boolean

模板是API 管理提供的默认模板还是已编辑。

properties.parameters

EmailTemplateParametersContractProperties[]

Email模板参数值。

properties.subject

string

模板的主题。

properties.title

string

模板的标题。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

EmailTemplateParametersContractProperties

Email模板参数协定。

名称 类型 说明
description

string

模板参数说明。

name

string

模板参数名称。

title

string

模板参数标题。

EmailTemplateUpdateParameters

Email模板更新参数。

名称 类型 说明
properties.body

string

Email模板正文。 这应该是有效的 XDocument

properties.description

string

Email模板的说明。

properties.parameters

EmailTemplateParametersContractProperties[]

Email模板参数值。

properties.subject

string

模板的主题。

properties.title

string

模板的标题。

ErrorFieldContract

错误字段协定。

名称 类型 说明
code

string

属性级错误代码。

message

string

属性级错误的可读表示形式。

target

string

属性名称。

ErrorResponse

错误响应。

名称 类型 说明
error.code

string

服务定义的错误代码。 此代码用作响应中指定的 HTTP 错误代码的子状态。

error.details

ErrorFieldContract[]

在发生验证错误时,请求中发送的无效字段列表。

error.message

string

错误的用户可读表示形式。

TemplateName

Email模板名称标识符。

名称 类型 说明
accountClosedDeveloper

string

applicationApprovedNotificationMessage

string

confirmSignUpIdentityDefault

string

emailChangeIdentityDefault

string

inviteUserNotificationMessage

string

newCommentNotificationMessage

string

newDeveloperNotificationMessage

string

newIssueNotificationMessage

string

passwordResetByAdminNotificationMessage

string

passwordResetIdentityDefault

string

purchaseDeveloperNotificationMessage

string

quotaLimitApproachingDeveloperNotificationMessage

string

rejectDeveloperNotificationMessage

string

requestDeveloperNotificationMessage

string