mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-30 03:42:13 +08:00
feat: add JUNK_MAIL_CHECK_LIST for check exits and passed item && add ParsedEmailContext to cache the parsed Email (#553)
* feat: Junk mail only check JUNK_MAIL_FORCE_PASS_LIST * feat: add `JUNK_MAIL_CHECK_LIST` for check exits and passed item && add `ParsedEmailContext` to cache the parsed Email
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Context } from "hono";
|
||||
import { HonoCustomType } from "../types";
|
||||
import { HonoCustomType, ParsedEmailContext } from "../types";
|
||||
import { CONSTANTS } from "../constants";
|
||||
import { AdminWebhookSettings, WebhookSettings } from "../models";
|
||||
import { getBooleanValue } from "../utils";
|
||||
@@ -39,8 +39,8 @@ async function testWebhookSettings(c: Context<HonoCustomType>): Promise<Response
|
||||
const { id: mailId, raw } = await c.env.DB.prepare(
|
||||
`SELECT id, raw FROM raw_mails WHERE address = ? ORDER BY RANDOM() LIMIT 1`
|
||||
).bind(address).first<{ id: string, raw: string }>() || {};
|
||||
|
||||
const parsedEmail = await commonParseMail(raw);
|
||||
const parsedEmailContext: ParsedEmailContext = { rawEmail: raw || "" };
|
||||
const parsedEmail = await commonParseMail(parsedEmailContext);
|
||||
const res = await sendWebhook(settings, {
|
||||
id: mailId || "0",
|
||||
url: c.env.FRONTEND_URL ? `${c.env.FRONTEND_URL}?mail_id=${mailId}` : "",
|
||||
|
||||
Reference in New Issue
Block a user