Improve Self host setup (#30)

* Add self host setup

* Improve blunders

* Move to bull mq

* More changes

* Add example code for sending test emails
This commit is contained in:
KM Koushik
2024-06-24 08:21:37 +10:00
committed by GitHub
parent 8a2769621c
commit f77a8829be
67 changed files with 1771 additions and 688 deletions

View File

@@ -35,6 +35,7 @@ model SesSetting {
configOpenSuccess Boolean @default(false)
configFull String?
configFullSuccess Boolean @default(false)
sesEmailRateLimit Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
@@ -162,23 +163,26 @@ model ApiKey {
enum EmailStatus {
QUEUED
SENT
BOUNCED
DELIVERED
OPENED
CLICKED
BOUNCED
COMPLAINED
DELIVERED
REJECTED
RENDERING_FAILURE
DELIVERY_DELAYED
FAILED
}
model Email {
id String @id @default(cuid())
sesEmailId String? @unique
to String
from String
to String[]
replyTo String[]
cc String[]
bcc String[]
subject String
replyTo String?
text String?
html String?
latestStatus EmailStatus @default(QUEUED)
@@ -192,11 +196,10 @@ model Email {
}
model EmailEvent {
id String @id @default(cuid())
emailId String
status EmailStatus
data Json?
createdAt DateTime @default(now())
email Email @relation(fields: [emailId], references: [id], onDelete: Cascade)
@@unique([emailId, status])
}