mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
configmap
This commit is contained in:
@@ -19,19 +19,21 @@ const mailTransport = nodemailer.createTransport({
|
||||
|
||||
const emailMap: { [key: string]: any } = {
|
||||
[UserAuthTypeEnum.register]: {
|
||||
subject: '注册 FastGPT 账号',
|
||||
html: (code: string) => `<div>您正在注册 FastGPT 账号,验证码为:${code}</div>`
|
||||
subject: `注册 ${global.feConfigs?.systemTitle} 账号`,
|
||||
html: (code: string) =>
|
||||
`<div>您正在注册 ${global.feConfigs?.systemTitle} 账号,验证码为:${code}</div>`
|
||||
},
|
||||
[UserAuthTypeEnum.findPassword]: {
|
||||
subject: '修改 FastGPT 密码',
|
||||
html: (code: string) => `<div>您正在修改 FastGPT 账号密码,验证码为:${code}</div>`
|
||||
subject: `修改 ${global.feConfigs?.systemTitle} 密码`,
|
||||
html: (code: string) =>
|
||||
`<div>您正在修改 ${global.feConfigs?.systemTitle} 账号密码,验证码为:${code}</div>`
|
||||
}
|
||||
};
|
||||
|
||||
export const sendEmailCode = (email: string, code: string, type: `${UserAuthTypeEnum}`) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = {
|
||||
from: `"FastGPT" ${myEmail}`,
|
||||
from: `"${global.feConfigs?.systemTitle}" ${myEmail}`,
|
||||
to: email,
|
||||
subject: emailMap[type]?.subject,
|
||||
html: emailMap[type]?.html(code)
|
||||
|
Reference in New Issue
Block a user