mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-12 02:50:46 +08:00
feat: support send mail from admin portal(no balance limit) (#524)
This commit is contained in:
22
worker/src/admin_api/send_mail.ts
Normal file
22
worker/src/admin_api/send_mail.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Context } from "hono";
|
||||
import { HonoCustomType } from "../types";
|
||||
import { sendMail } from "../mails_api/send_mail_api";
|
||||
|
||||
export const sendMailbyAdmin = async (c: Context<HonoCustomType>) => {
|
||||
const {
|
||||
from_name, from_mail,
|
||||
to_mail, to_name,
|
||||
subject, content, is_html
|
||||
} = await c.req.json();
|
||||
await sendMail(c, from_mail, {
|
||||
from_name: from_name,
|
||||
to_name: to_name,
|
||||
to_mail: to_mail,
|
||||
subject: subject,
|
||||
content: content,
|
||||
is_html: is_html,
|
||||
}, {
|
||||
isAdmin: true
|
||||
})
|
||||
return c.json({ status: "ok" });
|
||||
}
|
||||
Reference in New Issue
Block a user