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:
@@ -1,7 +1,6 @@
|
||||
import { createRoute, z } from "@hono/zod-openapi";
|
||||
import { PublicAPIApp } from "~/server/public-api/hono";
|
||||
import { getTeamFromToken } from "~/server/public-api/auth";
|
||||
import { sendEmail } from "~/server/service/email-service";
|
||||
import { db } from "~/server/db";
|
||||
import { EmailStatus } from "@prisma/client";
|
||||
import { UnsendApiError } from "../../api-error";
|
||||
@@ -30,7 +29,10 @@ const route = createRoute({
|
||||
schema: z.object({
|
||||
id: z.string(),
|
||||
teamId: z.number(),
|
||||
to: z.string(),
|
||||
to: z.string().or(z.array(z.string())),
|
||||
replyTo: z.string().or(z.array(z.string())).optional(),
|
||||
cc: z.string().or(z.array(z.string())).optional(),
|
||||
bcc: z.string().or(z.array(z.string())).optional(),
|
||||
from: z.string(),
|
||||
subject: z.string(),
|
||||
html: z.string().nullable(),
|
||||
|
@@ -12,10 +12,12 @@ const route = createRoute({
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: z.object({
|
||||
to: z.string().email(),
|
||||
from: z.string().email(),
|
||||
to: z.string().or(z.array(z.string())),
|
||||
from: z.string(),
|
||||
subject: z.string(),
|
||||
replyTo: z.string().optional(),
|
||||
replyTo: z.string().or(z.array(z.string())).optional(),
|
||||
cc: z.string().or(z.array(z.string())).optional(),
|
||||
bcc: z.string().or(z.array(z.string())).optional(),
|
||||
text: z.string().optional(),
|
||||
html: z.string().optional(),
|
||||
attachments: z
|
||||
|
@@ -15,7 +15,7 @@ export function getApp() {
|
||||
version: "1.0.0",
|
||||
title: "Unsend API",
|
||||
},
|
||||
servers: [{ url: `${env.APP_URL}/api` }],
|
||||
servers: [{ url: `${env.NEXTAUTH_URL}/api` }],
|
||||
}));
|
||||
|
||||
app.openAPIRegistry.registerComponent("securitySchemes", "Bearer", {
|
||||
|
Reference in New Issue
Block a user