mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-06 16:07:14 +08:00
feat: docs: add new-address-api (#309)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cloudflare_temp_email",
|
"name": "cloudflare_temp_email",
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
|
|||||||
{ text: '配置 Telegram Bot', link: 'feature/telegram' },
|
{ text: '配置 Telegram Bot', link: 'feature/telegram' },
|
||||||
{ text: '配置 S3 附件', link: 'feature/s3-attachment' },
|
{ text: '配置 S3 附件', link: 'feature/s3-attachment' },
|
||||||
{ text: '配置 worker 使用 wasm 解析邮件', link: 'feature/mail_parser_wasm_worker' },
|
{ text: '配置 worker 使用 wasm 解析邮件', link: 'feature/mail_parser_wasm_worker' },
|
||||||
|
{ text: '新建邮箱地址 API', link: 'feature/new-address-api' },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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())
|
||||||
|
```
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export const CONSTANTS = {
|
export const CONSTANTS = {
|
||||||
VERSION: 'v0.5.1',
|
VERSION: 'v0.5.2',
|
||||||
|
|
||||||
// DB settings
|
// DB settings
|
||||||
ADDRESS_BLOCK_LIST_KEY: 'address_block_list',
|
ADDRESS_BLOCK_LIST_KEY: 'address_block_list',
|
||||||
|
|||||||
Reference in New Issue
Block a user