feat: docs: add new-address-api (#309)

This commit is contained in:
Dream Hunter
2024-06-12 13:53:40 +08:00
committed by GitHub
parent af9f46ba65
commit c4d9fe1fb9
4 changed files with 28 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "cloudflare_temp_email",
"version": "0.5.1",
"version": "0.5.2",
"private": true,
"type": "module",
"scripts": {

View File

@@ -137,6 +137,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
{ text: '配置 Telegram Bot', link: 'feature/telegram' },
{ text: '配置 S3 附件', link: 'feature/s3-attachment' },
{ text: '配置 worker 使用 wasm 解析邮件', link: 'feature/mail_parser_wasm_worker' },
{ text: '新建邮箱地址 API', link: 'feature/new-address-api' },
]
},
{

View File

@@ -0,0 +1,25 @@
# 新建邮箱地址 API
## 通过 admin API 新建邮箱地址
这是一个 `python` 的例子,使用 `requests` 库发送邮件。
```python
res = requests.post(
# 替换 xxxx.xxxx 为你的 worker 域名
"https://xxxx.xxxx/admin/new_address",
json={
# 是否启用前缀 (True/False)
"enablePrefix": True,
"name": "<邮箱名称>",
"domain": "<邮箱域名>",
},
headers={
'x-admin-auth': "<你的网站admin密码>",
"Content-Type": "application/json"
}
)
# 返回值 {"jwt": "<Jwt>"}
print(res.json())
```

View File

@@ -1,5 +1,5 @@
export const CONSTANTS = {
VERSION: 'v0.5.1',
VERSION: 'v0.5.2',
// DB settings
ADDRESS_BLOCK_LIST_KEY: 'address_block_list',