mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-05-03 21:36:15 -04:00
feat(smtp-notification): add missing from name param to form (#429)
* feat(smtp-notification): add missing from name param to form * chore: gen api client
This commit is contained in:
@@ -2988,6 +2988,7 @@ export type GetScheduleNotificationsResponses = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -3099,6 +3100,7 @@ export type UpdateScheduleNotificationsResponses = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -3675,6 +3677,7 @@ export type ListNotificationDestinationsResponses = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -3757,6 +3760,7 @@ export type CreateNotificationDestinationData = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -3837,6 +3841,7 @@ export type CreateNotificationDestinationResponses = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -3966,6 +3971,7 @@ export type GetNotificationDestinationResponses = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -4048,6 +4054,7 @@ export type UpdateNotificationDestinationData = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
@@ -4138,6 +4145,7 @@ export type UpdateNotificationDestinationResponses = {
|
||||
to: Array<string>;
|
||||
type: "email";
|
||||
useTLS: boolean;
|
||||
fromName?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,20 @@ export const EmailForm = ({ form }: Props) => {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="fromName"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>From Name (Optional)</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} placeholder="Zerobyte Backup" />
|
||||
</FormControl>
|
||||
<FormDescription>The display name shown in the email client.</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="to"
|
||||
|
||||
@@ -21,6 +21,7 @@ export const emailNotificationConfigSchema = type({
|
||||
username: "string?",
|
||||
password: "string?",
|
||||
from: "string",
|
||||
fromName: "string?",
|
||||
to: "string[]",
|
||||
useTLS: "boolean",
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ export const buildEmailShoutrrrUrl = (config: Extract<NotificationConfig, { type
|
||||
const host = `${config.smtpHost}:${config.smtpPort}`;
|
||||
const toRecipients = config.to.map((email) => encodeURIComponent(email)).join(",");
|
||||
const useStartTLS = config.useTLS ? "yes" : "no";
|
||||
const fromNameParam = config.fromName ? `&fromname=${encodeURIComponent(config.fromName)}` : "";
|
||||
|
||||
return `smtp://${auth}${host}/?from=${encodeURIComponent(config.from)}&to=${toRecipients}&starttls=${useStartTLS}`;
|
||||
return `smtp://${auth}${host}/?from=${encodeURIComponent(config.from)}${fromNameParam}&to=${toRecipients}&starttls=${useStartTLS}`;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts";
|
||||
import { config } from "./app/server/core/config.js";
|
||||
|
||||
export default defineConfig({
|
||||
input: `http://${config.serverIp}:4096/api/v1/openapi.json`,
|
||||
input: `http://${config.serverIp}:3000/api/v1/openapi.json`,
|
||||
output: {
|
||||
path: "./app/client/api-client",
|
||||
postProcess: ["oxfmt"],
|
||||
|
||||
Reference in New Issue
Block a user