feat(viewer): 🐛 Fix multiple cc bcc email
This commit is contained in:
@ -1,12 +1,15 @@
|
||||
import {
|
||||
CredentialsType,
|
||||
defaultSettings,
|
||||
defaultTheme,
|
||||
PublicTypebot,
|
||||
SmtpCredentialsData,
|
||||
Step,
|
||||
Typebot,
|
||||
} from 'models'
|
||||
import { PrismaClient } from 'db'
|
||||
import { readFileSync } from 'fs'
|
||||
import { encrypt } from 'utils'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
@ -184,3 +187,20 @@ const createAnswers = () => {
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
export const createSmtpCredentials = (
|
||||
id: string,
|
||||
smtpData: SmtpCredentialsData
|
||||
) => {
|
||||
const { encryptedData, iv } = encrypt(smtpData)
|
||||
return prisma.credentials.create({
|
||||
data: {
|
||||
id,
|
||||
data: encryptedData,
|
||||
iv,
|
||||
name: smtpData.from.email as string,
|
||||
type: CredentialsType.SMTP,
|
||||
ownerId: 'proUser',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user