feat: update webhook to support global webhook (#407)

This commit is contained in:
Dream Hunter
2024-08-15 00:23:31 +08:00
committed by GitHub
parent c969c4b082
commit 621476cb79
17 changed files with 416 additions and 216 deletions

View File

@@ -4,8 +4,8 @@ import { getEnvStringList } from "../utils";
import { sendMailToTelegram } from "../telegram_api";
import { Bindings, HonoCustomType } from "../types";
import { auto_reply } from "./auto_reply";
import { trigerWebhook } from "../mails_api/webhook_settings";
import { isBlocked } from "./black_list";
import { triggerWebhook } from "../common";
async function email(message: ForwardableEmailMessage, env: Bindings, ctx: ExecutionContext) {
@@ -48,7 +48,7 @@ async function email(message: ForwardableEmailMessage, env: Bindings, ctx: Execu
// send webhook
try {
await trigerWebhook(
await triggerWebhook(
{ env: env } as Context<HonoCustomType>,
message.to, rawEmail
);