From 33aa35df90a8d2d649db256d9e4655e82ee07710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20N=C3=BDvlt?= Date: Mon, 26 Feb 2024 03:35:03 +0100 Subject: [PATCH] Fix things --- src/i18n.ts | 2 +- src/pages/[lang]/save.ts | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/i18n.ts b/src/i18n.ts index e8ad7c6..53a96d8 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -79,7 +79,7 @@ const translations: Record = { "form.gender.n": "ani jedno/nechci odpovídat", "form.branch": "Chci kontaktovat odpovědnou osobu na pobočce:", - "form.is_client": "Jsem klientem této pobočky", + "form.is_client": "Jsem klientem/klientkou této pobočky", "form.message": "Text zprávy", "form.fill_the_options": "Vyplň možnosti", diff --git a/src/pages/[lang]/save.ts b/src/pages/[lang]/save.ts index 5ae075b..fde496a 100644 --- a/src/pages/[lang]/save.ts +++ b/src/pages/[lang]/save.ts @@ -3,7 +3,6 @@ import type { Lang } from "../../lang"; import { letterFormSchema } from "../../letter/schema"; import { db } from "../../db"; import { generateToken } from "../../utils"; -import { join } from "node:path"; import { mailClient } from "../../mail"; import { renderMail } from "../../mails/confirm-email"; @@ -70,15 +69,15 @@ async function sendConfirmationEmail( lang: Lang, letter: { id: number; email: string; confirmationToken: string } ) { - const confirmationUrl = join( - import.meta.env.PUBLIC_URL, - lang, - "confirm", - String(letter.id), - letter.confirmationToken + const confirmationUrl = new URL( + `${lang}/${confirm}/${letter.id}/${letter.confirmationToken}`, + import.meta.env.PUBLIC_URL ); - const { title, htmlBody, plainBody } = await renderMail({ lang, confirmationUrl }); + const { title, htmlBody, plainBody } = await renderMail({ + lang, + confirmationUrl: confirmationUrl.toString(), + }); return await mailClient.send({ subject: title,