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:
parent
93aabebd51
commit
bde5302ca4
5 changed files with 26 additions and 2 deletions
|
|
@ -2988,6 +2988,7 @@ export type GetScheduleNotificationsResponses = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -3099,6 +3100,7 @@ export type UpdateScheduleNotificationsResponses = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -3675,6 +3677,7 @@ export type ListNotificationDestinationsResponses = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -3757,6 +3760,7 @@ export type CreateNotificationDestinationData = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -3837,6 +3841,7 @@ export type CreateNotificationDestinationResponses = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -3966,6 +3971,7 @@ export type GetNotificationDestinationResponses = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -4048,6 +4054,7 @@ export type UpdateNotificationDestinationData = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
@ -4138,6 +4145,7 @@ export type UpdateNotificationDestinationResponses = {
|
||||||
to: Array<string>;
|
to: Array<string>;
|
||||||
type: "email";
|
type: "email";
|
||||||
useTLS: boolean;
|
useTLS: boolean;
|
||||||
|
fromName?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
username?: string;
|
username?: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,20 @@ export const EmailForm = ({ form }: Props) => {
|
||||||
</FormItem>
|
</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
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="to"
|
name="to"
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ export const emailNotificationConfigSchema = type({
|
||||||
username: "string?",
|
username: "string?",
|
||||||
password: "string?",
|
password: "string?",
|
||||||
from: "string",
|
from: "string",
|
||||||
|
fromName: "string?",
|
||||||
to: "string[]",
|
to: "string[]",
|
||||||
useTLS: "boolean",
|
useTLS: "boolean",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ export const buildEmailShoutrrrUrl = (config: Extract<NotificationConfig, { type
|
||||||
const host = `${config.smtpHost}:${config.smtpPort}`;
|
const host = `${config.smtpHost}:${config.smtpPort}`;
|
||||||
const toRecipients = config.to.map((email) => encodeURIComponent(email)).join(",");
|
const toRecipients = config.to.map((email) => encodeURIComponent(email)).join(",");
|
||||||
const useStartTLS = config.useTLS ? "yes" : "no";
|
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";
|
import { config } from "./app/server/core/config.js";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
input: `http://${config.serverIp}:4096/api/v1/openapi.json`,
|
input: `http://${config.serverIp}:3000/api/v1/openapi.json`,
|
||||||
output: {
|
output: {
|
||||||
path: "./app/client/api-client",
|
path: "./app/client/api-client",
|
||||||
postProcess: ["oxfmt"],
|
postProcess: ["oxfmt"],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue