From bde5302ca41aa7fdc4178bffe12d1f423db781e5 Mon Sep 17 00:00:00 2001 From: Nico <47644445+nicotsx@users.noreply.github.com> Date: Thu, 29 Jan 2026 21:13:51 +0100 Subject: [PATCH] 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 --- app/client/api-client/types.gen.ts | 8 ++++++++ .../components/notification-forms/email-form.tsx | 14 ++++++++++++++ app/schemas/notifications.ts | 1 + app/server/modules/notifications/builders/email.ts | 3 ++- openapi-ts.config.ts | 2 +- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/client/api-client/types.gen.ts b/app/client/api-client/types.gen.ts index 67317865..6b706223 100644 --- a/app/client/api-client/types.gen.ts +++ b/app/client/api-client/types.gen.ts @@ -2988,6 +2988,7 @@ export type GetScheduleNotificationsResponses = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -3099,6 +3100,7 @@ export type UpdateScheduleNotificationsResponses = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -3675,6 +3677,7 @@ export type ListNotificationDestinationsResponses = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -3757,6 +3760,7 @@ export type CreateNotificationDestinationData = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -3837,6 +3841,7 @@ export type CreateNotificationDestinationResponses = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -3966,6 +3971,7 @@ export type GetNotificationDestinationResponses = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -4048,6 +4054,7 @@ export type UpdateNotificationDestinationData = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } @@ -4138,6 +4145,7 @@ export type UpdateNotificationDestinationResponses = { to: Array; type: "email"; useTLS: boolean; + fromName?: string; password?: string; username?: string; } diff --git a/app/client/modules/notifications/components/notification-forms/email-form.tsx b/app/client/modules/notifications/components/notification-forms/email-form.tsx index 43a7daf8..6231b5e3 100644 --- a/app/client/modules/notifications/components/notification-forms/email-form.tsx +++ b/app/client/modules/notifications/components/notification-forms/email-form.tsx @@ -82,6 +82,20 @@ export const EmailForm = ({ form }: Props) => { )} /> + ( + + From Name (Optional) + + + + The display name shown in the email client. + + + )} + /> 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}`; }; diff --git a/openapi-ts.config.ts b/openapi-ts.config.ts index 8a691832..1f60263e 100644 --- a/openapi-ts.config.ts +++ b/openapi-ts.config.ts @@ -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"],