feat: support send mail from admin portal(no balance limit) (#524)

This commit is contained in:
Dream Hunter
2024-12-22 15:40:26 +08:00
committed by GitHub
parent 0b48baff6d
commit a9bb8785ba
9 changed files with 245 additions and 9 deletions

View 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" });
}