Fix things

This commit is contained in:
Ondřej 2024-02-26 03:35:03 +01:00
parent 87458a312f
commit 33aa35df90
2 changed files with 8 additions and 9 deletions

View file

@ -79,7 +79,7 @@ const translations: Record<Lang, typeof reference> = {
"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",

View file

@ -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,