Merge pull request #13 from MIKU-N/patch-1

增加Outlook邮件发送告警示例(基于Microsoft Graph V1.0)
This commit is contained in:
naiba 2022-07-21 13:35:42 +08:00 committed by GitHub
commit 4aa07d2e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,34 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。
- Body: 空 - Body: 空
- URL 参数获取说明botXXXXXX 中的 XXXXXX 是在 telegram 中关注官方 @Botfather ,输入/newbot 创建新的机器人bot会提供的 token在提示 Use this token to access the HTTP API:后面一行)这里 'bot' 三个字母不可少。创建 bot 后,需要先在 telegram 中与 BOT 进行对话(随便发个消息),然后才可用 API 发送消息。YYYYYY 是 telegram 用户的数字 ID。与机器人@userinfobot 对话可获得。 - URL 参数获取说明botXXXXXX 中的 XXXXXX 是在 telegram 中关注官方 @Botfather ,输入/newbot 创建新的机器人bot会提供的 token在提示 Use this token to access the HTTP API:后面一行)这里 'bot' 三个字母不可少。创建 bot 后,需要先在 telegram 中与 BOT 进行对话(随便发个消息),然后才可用 API 发送消息。YYYYYY 是 telegram 用户的数字 ID。与机器人@userinfobot 对话可获得。
- Outlook 示例
- 名称MS邮件告警
- URLhttps://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail
- 请求方式: POST
- 请求类型: JSON
- Header: `{"Content-type":"application/json",
"Authorization":"Bearer {Token}"}`
- Body:
`{
"message": {
"subject": "服务器状态警报",
"body": {
"contentType": "Text",
"content": "#NEZHA#"
},
"toRecipients": [
{
"emailAddress": {
"address": "接收邮件地址"
}
}
]
}
}`
- URL 参数获取说明此方式调用Microsoft Graph V1.0,需要前往Microsoft Graph自行创建应用程序并授予`Mail.Send`权限并获取Token;或者你可以使用[Microsoft Graph Explorer](https://developer.microsoft.com/zh-cn/graph/graph-explorer)直接授予权限并获取Token。将Header中的Token字段替换为实际字符段即可。
<br/> <br/>
<br/> <br/>