邮件模板更新
POST
/api/v2/email/templates
请求参数
Header 参数
Authorization
string
必需
示例值:
Bearer token
x-authing-userpool-id
string
用户池 ID
示例值:
59f86b4832eb28071bdd9214
Body 参数application/json
type
string
必需
name
string
必需
subject
string
必需
sender
string
必需
content
string
必需
redirectTo
string
必需
hasURL
boolean
必需
expiresIn
integer
必需
示例
{
"type": "string",
"name": "string",
"subject": "string",
"sender": "string",
"content": "string",
"redirectTo": "string",
"hasURL": true,
"expiresIn": 0
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://core.authing.cn/api/v2/email/templates' \
--header 'Authorization: Bearer token' \
--header 'x-authing-userpool-id: 59f86b4832eb28071bdd9214' \
--header 'Content-Type: application/json' \
--data-raw ''
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
id
string
必需
createdAt
string
必需
updatedAt
string
必需
userPoolId
string
必需
type
string
必需
name
null
必需
subject
string
必需
content
string
必需
sender
string
必需
redirectTo
null
必需
hasURL
boolean
必需
expiresIn
null
必需
enabled
boolean
必需
tplEngine
string
必需
示例
{
"code": 200,
"message": "更新成功",
"data": {
"id": "61de9c8aeaad35e266fc2f99",
"createdAt": "2022-01-12T09:16:58.545Z",
"updatedAt": "2022-01-12T09:16:58.545Z",
"userPoolId": "59f86b4832eb28071bdd9214",
"type": "RESET_PASSWORD",
"name": null,
"subject": "您正在重置密码,验证码为:{{verify_code}}",
"content": "\n<div style=\"padding: 35px;\">\n\t<table cellpadding=\"0\" align=\"center\" style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:Microsoft YaHei, SimHei; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgba(18, 24, 37, 0.87); background-color: #484f60; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">\n\t\t\t\t\t<font face=\"Microsoft YaHei\" size=\"5\" style=\"color: rgb(255, 255, 255); \">{{client_name}} </font>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<div style=\"padding:25px 35px 40px; background-color:#fff;\">\n\t\t\t\t\t\t<h2 style=\"margin: 5px 0px; \">\n\t\t\t\t\t\t\t<font color=\"#333333\" style=\"line-height: 20px; \">\n\t\t\t\t\t\t\t\t<font style=\"line-height: 22px; \" size=\"4\">亲爱的用户:{{user_email}}</font>\n\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<p>您正在重置密码, 您的验证码为:<font style=\"color: #4a8db8\">{{verify_code}}</font>, 请尽快验证并保管好验证码。</p>\n\t\t\t\t\t\t<p align=\"right\">{{client_name}} 官方团队</p>\n\t\t\t\t\t\t<p align=\"right\">{{time}}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t</table>\n</div>",
"sender": "系统账户 <official@authing.cn>",
"redirectTo": null,
"hasURL": false,
"expiresIn": null,
"enabled": true,
"tplEngine": "handlebar"
}
}
修改于 2022-01-14 11:58:42