Fecify-邮件模版-测试发送

邮件模版-测试发送

接口信息

  • 接口地址: {your-site-url}/api/skill/notice/email-test
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/admin
  • 请求方式: POST
  • Content-Type: application/json
  • 说明: 对指定邮件类型的模版进行测试发送,将邮件发送到指定邮箱以查看实际效果。测试发送不会影响线上用户。

认证

请求头中需要携带 skill-access-token

Header
skill-access-token {your-skill-access-token} (请替换为你自己的 token)

请求参数

字段 类型 必填 说明
email_type Number 邮件类型 ID,对应 邮件类型列表type 值,也即 邮件模版-详情 中的 data.email.type
to_email_address String 接收测试邮件的邮箱地址

请求示例

cURL

curl --location --request POST '{your-site-url}/api/skill/notice/email-test' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email_type": 3,
    "to_email_address": "fecify@126.com"
}'

返回结果

code200 表示调用成功;code 不为 200 表示调用失败。

成功响应

{
    "code": 200,
    "data": [],
    "message": "success"
}

返回字段说明

字段 类型 说明
code Number 状态码,200 表示发送成功
message String 执行结果的文字描述
data Array 返回数据,发送成功时为空数组

注意事项

  1. 测试发送前请确保已通过 邮件设置-保存 完成 SMTP 配置。
  2. email_type 需为 邮件类型列表 中存在的类型值,系统将发送该类型对应的邮件模版。
  3. 测试邮件使用 邮件模版-详情 中的 body_html 内容,Liquid 变量会被示例数据替换。
  4. to_email_address 为接收测试邮件的实际邮箱地址,请确保该邮箱可正常收信。

results matching ""

    No results matching ""