Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Refactor email change flow (#1988)

Luke Vellaeb9a32931ba8
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index f24c86147..77fd99676 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -209,10 +209,7 @@
"unsubscribeToastTitle": "You have disabled notifications",
"unsubscribeToastDescription": "You will no longer receive notifications for this poll",
"emailChangeSuccess": "Email changed successfully",
- "emailChangeSuccessDescription": "Your email has been updated",
- "emailChangeFailed": "Email change failed",
"emailChangeInvalidToken": "The verification link is invalid or has expired. Please try again.",
- "emailChangeError": "An error occurred while changing your email",
"emailChangeRequestSent": "Verify your new email address",
"emailChangeRequestSentDescription": "To complete the change, please check your email for a verification link.",
"profileEmailAddress": "Email Address",
@@ -560,5 +557,6 @@
"passwordStrengthStrong": "Strong",
"passwordTooWeak": "Password is too weak. Please use a stronger password.",
"resetPasswordButton": "Reset password",
- "passwordStrength": "Password Strength"
+ "passwordStrength": "Password Strength",
+ "emailChangeInvalidUserId": "Please login with the same email address as the one you used to request the change."
}
diff --git a/apps/web/src/app/[locale]/(space)/settings/profile/profile-email-address.tsx b/apps/web/src/app/[locale]/(space)/settings/profile/profile-email-address.tsx
index 0f58bfd1f..22ea40d08 100644
--- a/apps/web/src/app/[locale]/(space)/settings/profile/profile-email-address.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/profile/profile-email-address.tsx
@@ -1,7 +1,6 @@
"use client";
import { zodResolver } from "@hookform/resolvers/zod";
-import { usePostHog } from "@rallly/posthog/client";
import { Alert, AlertDescription, AlertTitle } from "@rallly/ui/alert";
import { Button } from "@rallly/ui/button";
import {
@@ -13,9 +12,8 @@ import {
FormMessage,
} from "@rallly/ui/form";
import { Input } from "@rallly/ui/input";
-import { toast } from "@rallly/ui/sonner";
-import Cookies from "js-cookie";
-import { InfoIcon } from "lucide-react";
+import { CheckCircleIcon, InfoIcon, XIcon } from "lucide-react";
+import { useSearchParams } from "next/navigation";
import React from "react";
import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next";
@@ -32,7 +30,6 @@ type EmailChangeFormData = z.infer<typeof emailChangeFormData>;
export const ProfileEmailAddress = () => {
const { user } = useAuthenticatedUser();
const requestEmailChange = trpc.user.requestEmailChange.useMutation();
- const posthog = usePostHog();
const form = useForm<EmailChangeFormData>({
defaultValues: {
email: user?.email,
@@ -41,48 +38,13 @@ export const ProfileEmailAddress = () => {
});
const { t } = useTranslation("app");
+ const searchParams = useSearchParams();
+ const error = searchParams.get("error");
+ const didEmailChange = searchParams.get("emailChanged") === "true";
+
const [didRequestEmailChange, setDidRequestEmailChange] =
React.useState(false);
- React.useEffect(() => {
- const success = Cookies.get("email-change-success");
- const error = Cookies.get("email-change-error");
-
- if (success) {
- posthog.capture("email change completed");
- toast.message(
- t("emailChangeSuccess", {
- defaultValue: "Email changed successfully",
- }),
- {
- description: t("emailChangeSuccessDescription", {
- defaultValue: "Your email has been updated",
- }),
- },
- );
- }
-
- if (error) {
- posthog.capture("email change failed", { error });
- toast.error(
- t("emailChangeFailed", {
- defaultValue: "Email change failed",
- }),
- {
- description:
- error === "invalidToken"
- ? t("emailChangeInvalidToken", {
- defaultValue:
- "The verification link is invalid or has expired. Please try again.",
- })
- : t("emailChangeError", {
- defaultValue: "An error occurred while changing your email",
- }),
- },
- );
- }
- }, [posthog, t]);
-
const { handleSubmit, formState, reset } = form;
if (!user) {
@@ -95,7 +57,6 @@ export const ProfileEmailAddress = () => {
<form
onSubmit={handleSubmit(async (data) => {
if (data.email !== user.email) {
- posthog.capture("email change requested");
const res = await requestEmailChange.mutateAsync({
email: data.email,
});
@@ -150,6 +111,45 @@ export const ProfileEmailAddress = () => {
</AlertDescription>
</Alert>
) : null}
+ {didEmailChange ? (
+ <Alert variant="success">
+ <CheckCircleIcon />
+ <AlertDescription>
+ <p>
+ <Trans
+ i18nKey="emailChangeSuccess"
+ defaults="Email changed successfully"
+ />
+ </p>
+ </AlertDescription>
+ </Alert>
+ ) : null}
+ {error === "invalidToken" ? (
+ <Alert variant="destructive">
+ <XIcon />
+ <AlertDescription>
+ <p>
+ <Trans
+ i18nKey="emailChangeInvalidToken"
+ defaults="The verification link is invalid or has expired. Please try again."
+ />
+ </p>
+ </AlertDescription>
+ </Alert>
+ ) : null}
+ {error === "invalidUserId" ? (
+ <Alert variant="destructive">
+ <XIcon />
+ <AlertDescription>
+ <p>
+ <Trans
+ i18nKey="emailChangeInvalidUserId"
+ defaults="Please login with the same email address as the one you used to request the change."
+ />
+ </p>
+ </AlertDescription>
+ </Alert>
+ ) : null}
<div className="mt-4 flex">
<Button
loading={formState.isSubmitting}
diff --git a/apps/web/src/app/api/user/verify-email-change/route.ts b/apps/web/src/app/api/user/verify-email-change/route.ts
index 805a65625..db0267c23 100644
--- a/apps/web/src/app/api/user/verify-email-change/route.ts
+++ b/apps/web/src/app/api/user/verify-email-change/route.ts
@@ -2,8 +2,6 @@ import { stripe } from "@rallly/billing";
import { prisma } from "@rallly/database";
import { posthog } from "@rallly/posthog/server";
import * as Sentry from "@sentry/nextjs";
-import { waitUntil } from "@vercel/functions";
-import { cookies } from "next/headers";
import type { NextRequest } from "next/server";
import { NextResponse } from "next/server";
import { getSession } from "@/lib/auth";
@@ -14,23 +12,33 @@ type EmailChangePayload = {
toEmail: string;
};
-const COOKIE_CONFIG = {
- path: "/",
- httpOnly: false,
- secure: false,
- expires: new Date(Date.now() + 5 * 1000), // 5 seconds
-} as const;
+export const GET = async (request: NextRequest) => {
+ const token = request.nextUrl.searchParams.get("token");
-const setEmailChangeCookie = async (type: "success" | "error", value = "1") => {
- (await cookies()).set(`email-change-${type}`, value, COOKIE_CONFIG);
-};
+ if (!token) {
+ return NextResponse.json({ error: "No token provided" }, { status: 400 });
+ }
+
+ const session = await getSession();
+
+ if (!session?.user || session.user.isGuest) {
+ const loginUrl = new URL("/login", request.url);
+ loginUrl.searchParams.set("redirectTo", request.url);
+ return NextResponse.redirect(loginUrl);
+ }
-const handleEmailChange = async (token: string) => {
const payload = await decryptToken<EmailChangePayload>(token);
if (!payload) {
- await setEmailChangeCookie("error", "invalidToken");
- return false;
+ return NextResponse.redirect(
+ new URL("/settings/profile?error=invalidToken", request.url),
+ );
+ }
+
+ if (payload.userId !== session.user.id) {
+ return NextResponse.redirect(
+ new URL("/settings/profile?error=invalidUserId", request.url),
+ );
}
const user = await prisma.user.update({
@@ -61,31 +69,17 @@ const handleEmailChange = async (token: string) => {
Sentry.captureException(error);
}
- await setEmailChangeCookie("success");
-
- if (posthog) {
- waitUntil(posthog.flush());
- }
-
- return true;
-};
-
-export const GET = async (request: NextRequest) => {
- const token = request.nextUrl.searchParams.get("token");
-
- if (!token) {
- return NextResponse.json({ error: "No token provided" }, { status: 400 });
- }
-
- const session = await getSession();
-
- if (!session?.user || session.user.isGuest) {
- return NextResponse.redirect(
- new URL(`/login?redirectTo=${request.url}`, request.url),
- );
- }
-
- await handleEmailChange(token);
+ posthog?.capture({
+ event: "account_email_change_complete",
+ distinctId: session.user.id,
+ properties: {
+ $set: {
+ email: payload.toEmail,
+ },
+ },
+ });
- return NextResponse.redirect(new URL("/settings/profile", request.url));
+ return NextResponse.redirect(
+ new URL("/settings/profile?emailChanged=true", request.url),
+ );
};
diff --git a/packages/emails/locales/cs/emails.json b/packages/emails/locales/cs/emails.json
index 84bcb5fb3..d8e8dcf59 100644
--- a/packages/emails/locales/cs/emails.json
+++ b/packages/emails/locales/cs/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Konečný termín rezervován!",
"finalizeParticipant_content2": "V příloze najdete pozvánku do kalendáře na tuto událost.",
"finalizeParticipant_subject": "Datum rezervováno pro {title}",
+ "login_button": "Přihlásit se na {domain}",
"login_content2": "Tento e-mail dostáváte, protože byl podán požadavek na přihlášení na <domain />. Pokud to nebyla vaše žádost, kontaktujte <a>{supportEmail}</a>.",
+ "login_preview": "Použijte tento odkaz pro přihlášení na tomto zařízení.",
+ "login_heading": "Přihlásit",
+ "login_content": "Zadejte tento jednorázový 6místný ověřovací kód:",
+ "login_codeValid": "Tento kód je platný po dobu 15 minut",
+ "login_subject": "{code} je váš 6místný kód",
"newComment_content": "<b>{authorName}</b> okomentoval <b>{title}</b>.",
"newComment_subject": "{authorName} okomentoval {title}",
"newParticipantConfirmation_content": "Vaše reakce na <b>{title}</b> byla odeslána.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nová anketa vytvořena",
"newPoll_button": "Spravovat anketu",
"newPoll_subject": "Pojďme najít vhodné datum pro {title}!",
+ "register_footer": "Tento e-mail dostáváte, protože byla podána žádost o registraci účtu na <domain />. Pokud to nebyla vaše žádost, prosím, ignorujte tento e-mail.",
"register_preview": "Váš 6místný kód je: {code}",
"register_heading": "Ověřte svou e-mailovou adresu",
"register_text": "Použijte následující 6místný ověřovací kód pro ověření své e-mailové adresy",
@@ -56,7 +63,6 @@
"abandoned_checkout_preview": "Exkluzivní nabídka: Získejte {discount}% slevu z prvního roku Rallly Pro!",
"abandoned_checkout_subject": "Získejte {discount}% slevu z prvního roku Rallly Pro",
"abandoned_checkout_signoff": "S pozdravem,",
- "license_key_plan": "Plán",
"spaceInvite_content": "{inviterName} vás pozval, abyste se připojil k {spaceName} jako {role}.",
"spaceInvite_preview": "Byli jste pozváni k připojení do {spaceName}",
"spaceInvite_heading": "Jste zváni!",
diff --git a/packages/emails/locales/da/emails.json b/packages/emails/locales/da/emails.json
index 4612d6963..0a698ef3c 100644
--- a/packages/emails/locales/da/emails.json
+++ b/packages/emails/locales/da/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Endelig dato booket!",
"finalizeParticipant_content2": "Kalenderinvitation til dette arrangement er vedhæftet.",
"finalizeParticipant_subject": "Dato booket for {title}",
+ "login_button": "Log ind på {domain}",
"login_content2": "Du modtager denne e-mail, fordi der blev anmodet om at logge ind på <domain />. Hvis det ikke var dig, kontakt <a>{supportEmail}</a>.",
+ "login_preview": "Brug dette link for at logge ind på denne enhed.",
+ "login_heading": "Log ind",
+ "login_content": "Indtast denne 6-cifrede verifikationskode:",
+ "login_codeValid": "Denne kode er gyldig i 15 minutter",
+ "login_subject": "{code} er din 6-cifrede kode",
"newComment_content": "<b>{authorName}</b> har kommenteret på <b>{title}</b>.",
"newComment_subject": "{authorName} har kommenteret på {title}",
"newParticipantConfirmation_content": "Dit svar på <b>{title}</b> er blevet sendt.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Ny afstemning oprettet",
"newPoll_button": "Administrer afstemning",
"newPoll_subject": "Lad os finde en dato for {title}!",
+ "register_footer": "Du modtager denne e-mail, fordi der blev anmodet om at registrere en konto på <domain />. Hvis det ikke var dig, bedes du ignorere denne e-mail.",
"register_preview": "Din 6-cifrede kode er: {code}",
"register_heading": "Bekræft din e-mail adresse",
"register_text": "Brug venligst den følgende 6-cifrede verifikationskode til at verificere din e-mail",
diff --git a/packages/emails/locales/de/emails.json b/packages/emails/locales/de/emails.json
index 909ce8ea0..d016dc913 100644
--- a/packages/emails/locales/de/emails.json
+++ b/packages/emails/locales/de/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Endgültiger Termin gebucht!",
"finalizeParticipant_content2": "Im Anhang finden Sie eine Kalendereinladung für diesen Termin.",
"finalizeParticipant_subject": "Datum für {title}",
+ "login_button": "Login bei {domain}",
"login_content2": "Sie erhalten diese E-Mail, weil eine Anfrage gestellt wurde, sich bei <domain /> anzumelden. Wenn dies nicht der Fall war, kontaktieren Sie <a>{supportEmail}</a>.",
+ "login_preview": "Verwenden Sie diesen Link, um sich auf diesem Gerät anzumelden.",
+ "login_heading": "Einloggen",
+ "login_content": "Geben Sie diesen 6-stelligen Bestätigungscode ein:",
+ "login_codeValid": "Dieser Code ist 15 Minuten lang gültig",
+ "login_subject": "{code} ist dein 6-stelliger Code",
"newComment_content": "<b>{authorName}</b> hat <b>{title}</b> kommentiert.",
"newComment_subject": "{authorName} hat {title} kommentiert",
"newParticipantConfirmation_content": "Deine Antwort auf <b>{title}</b> wurde abgeschickt.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Neue Umfrage erstellt",
"newPoll_button": "Umfrage verwalten",
"newPoll_subject": "Lass uns einen Termin für {title} finden!",
+ "register_footer": "Sie erhalten diese E-Mail, weil eine Anfrage zur Registrierung eines Kontos bei <domain /> gestellt wurde. Wenn dies nicht Sie waren, ignorieren Sie bitte diese E-Mail.",
"register_preview": "Dein 6-stelliger Code lautet: {code}",
"register_heading": "Bestätige Deine E-Mail-Adresse",
"register_text": "Bitte verwende den folgenden 6-stelligen Verifizierungscode zur Bestätigung Deiner E-Mail",
@@ -76,11 +83,5 @@
"spaceInvite_preview": "Du wurdest eingeladen, {spaceName} beizutreten",
"spaceInvite_heading": "Du wurdest eingeladen!",
"spaceInvite_button": "Einladung annehmen",
- "spaceInvite_subject": "Du wurdest eingeladen, {spaceName} beizutreten",
- "resetPassword_button": "Passwort zurücksetzen",
- "resetPassword_content2": "Wenn du das Zurücksetzen des Passworts nicht angefordert hast, kannst du diese E-Mail ignorieren. Dein Passwort ändert sich nicht, es sei denn, du erstellst ein neues. Wenn du diese Anfrage für verdächtig hältst, wenden dich an <a>{supportEmail}</a>.",
- "resetPassword_preview": "Verwende diesen Link, um dein Passwort zurückzusetzen.",
- "resetPassword_heading": "Passwort zurücksetzen",
- "resetPassword_content": "Wir haben eine Anfrage zum Zurücksetzen deines Passworts erhalten. Klicke auf die Schaltfläche unten, um ein neues Passwort zu erstellen.",
- "resetPassword_subject": "Passwort zurücksetzen"
+ "spaceInvite_subject": "Du wurdest eingeladen, {spaceName} beizutreten"
}
diff --git a/packages/emails/locales/es/emails.json b/packages/emails/locales/es/emails.json
index 86dbf1c3a..aa28c75fe 100644
--- a/packages/emails/locales/es/emails.json
+++ b/packages/emails/locales/es/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "¡Fecha final programada!",
"finalizeParticipant_content2": "Por favor, encuentra adjunta una invitación de calendario para este evento.",
"finalizeParticipant_subject": "Fecha programada para {title}",
+ "login_button": "Iniciar sesión en {domain}",
"login_content2": "Estás recibiendo este correo electrónico porque se realizó una solicitud para iniciar sesión en <domain />. Si no fuiste tú, contacta a <a>{supportEmail}</a>.",
+ "login_preview": "Usa este enlace para iniciar sesión en este dispositivo.",
+ "login_heading": "Iniciar sesión",
+ "login_content": "Introduce este código de verificación único de 6 dígitos:",
+ "login_codeValid": "Este código es válido por 15 minutos",
+ "login_subject": "{code} es tu código de 6 dígitos",
"newComment_content": "<b>{authorName}</b> ha comentado en <b>{title}</b>.",
"newComment_subject": "{authorName} ha comentado en {title}",
"newParticipantConfirmation_content": "Tu respuesta a <b>{title}</b> ha sido enviada.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nueva encuesta creada",
"newPoll_button": "Administrar encuesta",
"newPoll_subject": "¡Busquemos una fecha para {title}!",
+ "register_footer": "Estás recibiendo este correo electrónico porque se realizó una solicitud para registrar una cuenta en <domain />. Si no fuiste tú, por favor, ignora este correo electrónico.",
"register_preview": "Tu código de 6 dígitos es: {code}",
"register_heading": "Verifica tu dirección de correo electrónico",
"register_text": "Por favor, utiliza el siguiente código de verificación de 6 dígitos para verificar tu correo electrónico",
diff --git a/packages/emails/locales/fi/emails.json b/packages/emails/locales/fi/emails.json
index c85e43876..97557fdda 100644
--- a/packages/emails/locales/fi/emails.json
+++ b/packages/emails/locales/fi/emails.json
@@ -1,6 +1,6 @@
{
"common_poweredBy": "Palvelun tarjoaa <a>{domain}</a>",
- "common_disableNotifications": "Jos et halua saada päivityksiä, voit kytkeä <a>ilmoitukset pois päältä</a>.",
+ "common_disableNotifications": "Jos et halua saada päivityksiä, voit <a>pois päältä ilmoitukset</a>.",
"finalizeHost_content": "<b>{title}</b> on varattu seuraavasti:",
"finalizeHost_preview": "Lopullinen päivä varattu! Olemme ilmoittaneet osallistujille ja lähettäneet heille kalenterikutsut.",
"finalizeHost_heading": "Lopullinen päivä varattu!",
@@ -12,16 +12,22 @@
"finalizeParticipant_heading": "Lopullinen päivä varattu!",
"finalizeParticipant_content2": "Oheisena on kalenterikutsu tähän tapahtumaan.",
"finalizeParticipant_subject": "Päivä varattu {title}",
+ "login_button": "Kirjaudu sisään {domain}",
"login_content2": "Saat tämän sähköpostin, koska varattiin kirjautumista <domain />. Jos tämä ei ollut sinä, ota yhteyttä <a>{supportEmail}</a>.",
+ "login_preview": "Käytä tätä linkkiä kirjautuaksesi tälle laitteelle.",
+ "login_heading": "Kirjaudu sisään",
+ "login_content": "Anna tämä kertakäyttöinen 6-numeroinen vahvistuskoodi:",
+ "login_codeValid": "Tämä koodi on voimassa 15 minuuttia",
+ "login_subject": "{code} on 6-numeroinen koodisi",
"newComment_content": "<b>{authorName}</b> on kommentoinut <b>{title}</b>.",
"newComment_subject": "{authorName} on kommentoinut {title}",
"newParticipantConfirmation_content": "Vastauksesi <b>{title}</b> on lähetetty.",
"newParticipantConfirmation_content2": "Kun kysely on edelleen avoinna, voit muuttaa vastaustasi alla olevan linkin avulla.",
- "newParticipantConfirmation_button": "Tarkista vastaus osoitteessa {domain}",
+ "newParticipantConfirmation_button": "Tarkista vastaus {domain}",
"newParticipantConfirmation_footnote": "Saat tämän sähköpostin, koska vastaus lähetettiin <domain />. Jos tämä ei ollut sinä, voit ignoroida tämän viestin.",
- "newParticipantConfirmation_preview": "Käytä alla olevaa linkkiä muokataksesi vastaustasi",
+ "newParticipantConfirmation_preview": "Muokata vastaustasi, käytä alla olevaa linkkiä",
"newParticipantConfirmation_heading": "Kyselyn vastausvahvistus",
- "newParticipantConfirmation_subject": "Kiitos vastauksestasi kyselyyn {title}",
+ "newParticipantConfirmation_subject": "Kiitos vastauksestasi {title}",
"newParticipant_content": "<b>{name}</b> on vastannut <b>{title}</b>.",
"newParticipant_content2": "Siirry kyselyysi nähdäksesi uusi vastaus.",
"newParticipant_preview": "Siirry kyselyysi nähdäksesi uusi vastaus.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Uusi kysely luotu",
"newPoll_button": "Hallinnoi kyselyä",
"newPoll_subject": "Etsitään päivämäärää {title}!",
+ "register_footer": "Saat tämän sähköpostin, koska tiliä varattiin <domain />. Jos tämä ei ollut sinä, voit ignoroida tämän viestin.",
"register_preview": "6-numeroinen koodisi on: {code}",
"register_heading": "Vahvista sähköpostiosoitteesi",
"register_text": "Käytä seuraavaa 6-numerosta vahvistuskoodia vahvistaaksesi sähköpostiosoitteesi",
diff --git a/packages/emails/locales/fr/emails.json b/packages/emails/locales/fr/emails.json
index e57eac657..44c7c94c0 100644
--- a/packages/emails/locales/fr/emails.json
+++ b/packages/emails/locales/fr/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Date finale réservée !",
"finalizeParticipant_content2": "Veuillez trouver ci-joint une invitation de calendrier pour cet événement.",
"finalizeParticipant_subject": "Date réservée pour {title}",
+ "login_button": "Connectez-vous à {domain}",
"login_content2": "Vous recevez cet e-mail parce qu'une demande a été faite pour se connecter à <domain />. Si ce n'était pas vous, contactez <a>{supportEmail}</a>.",
+ "login_preview": "Utilisez ce lien pour vous connecter sur cet appareil.",
+ "login_heading": "Connexion",
+ "login_content": "Entrez ce code de vérification à usage unique à 6 chiffres :",
+ "login_codeValid": "Ce code est valable pendant 15 minutes",
+ "login_subject": "{code} est votre code à 6 chiffres",
"newComment_content": "<b>{authorName}</b> a commenté <b>{title}</b>.",
"newComment_subject": "{authorName} a commenté {title}",
"newParticipantConfirmation_content": "Votre réponse à <b>{title}</b> a été soumise.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nouveau sondage créé",
"newPoll_button": "Gérer le sondage",
"newPoll_subject": "Trouvons une date pour {title} !",
+ "register_footer": "Vous recevez cet e-mail parce qu'une demande a été faite pour enregistrer un compte sur <domain />. Si ce n'était pas vous, veuillez ignorer cet e-mail.",
"register_preview": "Votre code à 6 chiffres est : {code}",
"register_heading": "Vérifiez votre e-mail",
"register_text": "Veuillez utiliser le code de vérification à 6 chiffres suivant pour vérifier votre e-mail",
@@ -55,10 +62,5 @@
"abandoned_checkout_support": "Si vous avez des questions à propos de Rallly Pro ou si vous avez besoin d'aide, répondez à cet e-mail. Je suis là pour vous aider !",
"abandoned_checkout_preview": "Offre exclusive : Obtenez {discount}% de réduction sur votre première année de Rallly Pro!",
"abandoned_checkout_subject": "Obtenez {discount}% de réduction sur votre première année de Rallly Pro",
- "abandoned_checkout_signoff": "Cordialement,",
- "license_key_plan": "Forfait",
- "license_key_licenseKey": "Clé de licence",
- "license_key_nextStepsHeading": "Étapes suivantes",
- "eventCanceledPreview": "Événement annulé",
- "eventCanceledHeading": "Événement annulé"
+ "abandoned_checkout_signoff": "Cordialement,"
}
diff --git a/packages/emails/locales/hu/emails.json b/packages/emails/locales/hu/emails.json
index 8f1579381..17e270380 100644
--- a/packages/emails/locales/hu/emails.json
+++ b/packages/emails/locales/hu/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Végleges dátum rögzítve!",
"finalizeParticipant_content2": "Mellékeltünk egy naptár meghívót is ehhez az eseményhez.",
"finalizeParticipant_subject": "{title} dátuma véglegesítve",
+ "login_button": "Bejelentkezés: {domain}",
"login_content2": "Ezt az emailt azért kaptad, mert bejelentkezési kísérlet történt a(z) <domain />-ra. Ha ez nem te voltál, lépj kapcsolatba a(z) <a>{supportEmail}</a> címmel.",
+ "login_preview": "Használd ezt a linket, hogy bejelentkezz ezen az eszközön.",
+ "login_heading": "Bejelentkezés",
+ "login_content": "Add meg ezt az egyszer használatos hatjegyű ellenőrző kódot:",
+ "login_codeValid": "Ez a kód 15 percig érvényes",
+ "login_subject": "A hatjegyű kódod: {code}",
"newComment_content": "<b>{authorName}</b> hozzászólt ehhez: <b>{title}</b>.",
"newComment_subject": "{authorName} hozzászólt ehhez: {title}",
"newParticipantConfirmation_content": "Rögzítettük válaszod a(z) <b>{title}</b> szavazásnál.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Új szavazás létrehozva",
"newPoll_button": "Szavazás kezelése",
"newPoll_subject": "Találjunk egy időpontot ennek: {title}!",
+ "register_footer": "Ezt az emailt azért kaptad, mert egy <domain /> fiók regisztráció kérés érkezett. Ha ez nem te voltál, kérjük, hogy hagyd figyelmen kívül ezt az emailt.",
"register_preview": "A hatjegyű kódod: {code}",
"register_heading": "Hitelesítsd az email címed",
"register_text": "Kérjük, használd a következő hatjegyű ellenőrző kódot az email címed hitelesítéséhez",
diff --git a/packages/emails/locales/it/emails.json b/packages/emails/locales/it/emails.json
index 5d65704b4..7195c615e 100644
--- a/packages/emails/locales/it/emails.json
+++ b/packages/emails/locales/it/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Data finale prenotata!",
"finalizeParticipant_content2": "Troverai in allegato un invito in calendario per questo evento.",
"finalizeParticipant_subject": "Data prenotata per {title}",
+ "login_button": "Accedi a {domain}",
"login_content2": "Hai ricevuto questa email perché è stata effettuata una richiesta di accesso a <domain />. Se non sei stato tu contatta <a>{supportEmail}</a>.",
+ "login_preview": "Usa questo link per accedere su questo dispositivo.",
+ "login_heading": "Login",
+ "login_content": "Inserisci questo codice di verifica a 6 cifre una sola volta:",
+ "login_codeValid": "Questo codice è valido per 15 minuti",
+ "login_subject": "{code} è il tuo codice a 6 cifre",
"newComment_content": "<b>{authorName}</b> ha commentato <b>{title}</b>.",
"newComment_subject": "{authorName} ha commentato {title}",
"newParticipantConfirmation_content": "La tua risposta a <b>{title}</b> è stata inviata.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nuovo Sondaggio Creato",
"newPoll_button": "Gestisci Sondaggio",
"newPoll_subject": "Troviamo una data per {title}!",
+ "register_footer": "Hai ricevuto questa email perché è stata effettuata una richiesta di registrazione di un account su <domain />. Se non sei stato tu, ignora questa email.",
"register_preview": "Il tuo codice a 6 cifre è: {code}",
"register_heading": "Verifica il tuo indirizzo email",
"register_text": "Si prega di utilizzare il seguente codice di verifica a 6 cifre per verificare la tua email",
diff --git a/packages/emails/locales/nl/emails.json b/packages/emails/locales/nl/emails.json
index c5c2bd74d..f90a8471b 100644
--- a/packages/emails/locales/nl/emails.json
+++ b/packages/emails/locales/nl/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Definitieve datum vastgelegd!",
"finalizeParticipant_content2": "Een agenda-uitnodiging voor deze afspraak is bijgevoegd.",
"finalizeParticipant_subject": "Datum vastgesteld voor {title}",
+ "login_button": "Inloggen op {domain}",
"login_content2": "Je ontvangt dit bericht omdat er een verzoek is gedaan om in te loggen op <domain />. Als jij dit niet was, neem dan contact op via <a>{supportEmail}</a>.",
+ "login_preview": "Gebruik deze link om in te loggen op dit apparaat.",
+ "login_heading": "Inloggen",
+ "login_content": "Voer deze eenmalige 6-cijferige verificatiecode in:",
+ "login_codeValid": "Deze code is 15 minuten geldig",
+ "login_subject": "{code} is je 6-cijferige code",
"newComment_content": "<b>{authorName}</b> heeft gereageerd op <b>{title}</b>.",
"newComment_subject": "{authorName} heeft gereageerd op {title}",
"newParticipantConfirmation_content": "Je reactie op <b>{title}</b> is ingediend.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nieuwe poll gemaakt",
"newPoll_button": "Poll beheren",
"newPoll_subject": "Laten we een datum vinden voor {title}!",
+ "register_footer": "Je ontvangt dit bericht omdat er een verzoek is gedaan om een account te registreren op <domain />. Als jij dit niet was, dan kun je dit bericht negeren.",
"register_preview": "Je 6-cijferige code is: {code}",
"register_heading": "Verifieer je e-mailadres",
"register_text": "Gebruik de volgende 6-cijferige verificatiecode om je e-mailadres te verifiëren",
diff --git a/packages/emails/locales/no/emails.json b/packages/emails/locales/no/emails.json
index 6037cf528..11ad80d3f 100644
--- a/packages/emails/locales/no/emails.json
+++ b/packages/emails/locales/no/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Sluttdato bestilt!",
"finalizeParticipant_content2": "Vennligst finn vedlagt en kalenderinvitasjon for dette arrangementet.",
"finalizeParticipant_subject": "Dato bestilt for {title}",
+ "login_button": "Logg inn på {domain}",
"login_content2": "Du mottar denne e-posten fordi en forespørsel ble gjort om å logge inn på <domain />. Hvis dette ikke var deg, kontakt <a>{supportEmail}</a>.",
+ "login_preview": "Bruk denne lenken for å logge inn på denne enheten.",
+ "login_heading": "Logg inn",
+ "login_content": "Skriv inn den sekssifrede engangskoden:",
+ "login_codeValid": "Denne koden er gyldig i 15 minutter",
+ "login_subject": "{code} er din sekssifrede kode",
"newComment_content": "<b>{authorName}</b> har kommentert på <b>{title}</b>.",
"newComment_subject": "{authorName} har kommentert på {title}",
"newParticipantConfirmation_content": "Din respons på <b>{title}</b> har blitt sendt inn.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Ny avstemning opprettet",
"newPoll_button": "Administrer avstemning",
"newPoll_subject": "La oss finne en dato for {title}!",
+ "register_footer": "Du mottar denne e-posten fordi en forespørsel ble gjort om å registrere en konto på <domain />. Hvis dette ikke var deg, vennligst ignorer denne e-posten.",
"register_preview": "Din sekssifrede kode er: {code}",
"register_heading": "Bekreft e-postadressen din",
"register_text": "Vennligst bruk den følgende sekssifrede bekreftelseskoden for å bekrefte e-posten din",
@@ -39,7 +46,5 @@
"common_viewOn": "Se på {domain}",
"newComment_preview": "Gå til avstemningen din for å se hva de sa.",
"newComment_heading": "Ny kommentar",
- "changeEmailRequest_subject": "Bekreft din nye e-postadresse",
- "license_key_plan": "Abonnement",
- "license_key_licenseKey": "Lisensnøkkel"
+ "changeEmailRequest_subject": "Bekreft din nye e-postadresse"
}
diff --git a/packages/emails/locales/pl/emails.json b/packages/emails/locales/pl/emails.json
index c7de12b88..6213c9f4f 100644
--- a/packages/emails/locales/pl/emails.json
+++ b/packages/emails/locales/pl/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Ostateczna data zarezerwowana!",
"finalizeParticipant_content2": "W załączeniu znajduje się zaproszenie kalendarzowe na to wydarzenie.",
"finalizeParticipant_subject": "Data zarezerwowana na {title}",
+ "login_button": "Zaloguj się do {domain}",
"login_content2": "Otrzymujesz ten e-mail, ponieważ dokonano prośby o zalogowanie się do <domain />. Jeśli to nie ty, skontaktuj się z <a>{supportEmail}</a>.",
+ "login_preview": "Użyj tego linku, aby zalogować się na tym urządzeniu.",
+ "login_heading": "Logowanie",
+ "login_content": "Wpisz ten jednorazowy 6-cyfrowy kod weryfikacyjny:",
+ "login_codeValid": "Ten kod jest ważny przez 15 minut",
+ "login_subject": "{code} to twój 6-cyfrowy kod",
"newComment_content": "<b>{authorName}</b> skomentował <b>{title}</b>.",
"newComment_subject": "{authorName} skomentował {title}",
"newParticipantConfirmation_content": "Twoja odpowiedź na <b>{title}</b> została wysłana.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nowa ankieta utworzona",
"newPoll_button": "Zarządzaj ankietą",
"newPoll_subject": "Znaleźć datę dla {title}!",
+ "register_footer": "Otrzymujesz ten e-mail, ponieważ dokonano prośby o zarejestrowanie konta na <domain />. Jeśli to nie ty, zignoruj ten e-mail.",
"register_preview": "Twój 6-cyfrowy kod to: {code}",
"register_heading": "Zweryfikuj swój adres e-mail",
"register_text": "Proszę użyć poniższego 6-cyfrowego kodu weryfikacyjnego, aby zweryfikować swój e-mail",
diff --git a/packages/emails/locales/pt-BR/emails.json b/packages/emails/locales/pt-BR/emails.json
index cf0dfe193..9f5717aad 100644
--- a/packages/emails/locales/pt-BR/emails.json
+++ b/packages/emails/locales/pt-BR/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Data final agendada!",
"finalizeParticipant_content2": "Por favor, encontre anexado um convite de calendário para este evento.",
"finalizeParticipant_subject": "Data agendada para {title}",
+ "login_button": "Logar em {domain}",
"login_content2": "Você está recebendo este e-mail porque foi feito um pedido para fazer login em <domain />. Se não foi você, entre em contato com <a>{supportEmail}</a>.",
+ "login_preview": "Use este link para fazer login neste dispositivo.",
+ "login_heading": "Login",
+ "login_content": "Insira este código de verificação de 6 dígitos:",
+ "login_codeValid": "Este código é válido por 15 minutos",
+ "login_subject": "{code} é o seu código de 6 dígitos",
"newComment_content": "<b>{authorName}</b> comentou sobre <b>{title}</b>.",
"newComment_subject": "{authorName} comentou sobre {title}",
"newParticipantConfirmation_content": "Sua resposta para <b>{title}</b> foi enviada.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Nova Enquete Criada",
"newPoll_button": "Gerenciar Enquete",
"newPoll_subject": "Vamos encontrar uma data para {title}!",
+ "register_footer": "Você está recebendo este e-mail porque foi feito um pedido para registrar uma conta em <domain />. Se não foi você, por favor, ignore este e-mail.",
"register_preview": "Seu código de 6 dígitos é: {code}",
"register_heading": "Verifique seu e-mail",
"register_text": "Por favor, use o seguinte código de verificação de 6 dígitos para verificar seu e-mail",
diff --git a/packages/emails/locales/ru/emails.json b/packages/emails/locales/ru/emails.json
index f7dd1c3ec..6787a8847 100644
--- a/packages/emails/locales/ru/emails.json
+++ b/packages/emails/locales/ru/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Конечная дата забронирована!",
"finalizeParticipant_content2": "Пожалуйста, найдите прикрепленное приглашение в календаре для этого события.",
"finalizeParticipant_subject": "Дата забронирована для {title}",
+ "login_button": "Войти на {domain}",
"login_content2": "Вы получаете это письмо, потому что был сделан запрос на вход в <domain />. Если это не вы, свяжитесь с <a>{supportEmail}</a>.",
+ "login_preview": "Используйте эту ссылку, чтобы войти на этом устройстве.",
+ "login_heading": "Войти",
+ "login_content": "Введите код из 6 цифр:",
+ "login_codeValid": "Этот код действителен в течение 15 минут",
+ "login_subject": "{code} — это ваш 6-значный код",
"newComment_content": "<b>{authorName}</b> прокомментировал <b>{title}</b>.",
"newComment_subject": "{authorName} прокомментировал {title}",
"newParticipantConfirmation_content": "Ваш ответ на <b>{title}</b> был отправлен.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Новый опрос создан",
"newPoll_button": "Управлять опросом",
"newPoll_subject": "Давайте найдем дату для {title}!",
+ "register_footer": "Вы получаете это письмо, потому что был сделан запрос на регистрацию учетной записи на <domain />. Если это не вы, пожалуйста, проигнорируйте это письмо.",
"register_preview": "Ваш 6-значный код: {code}",
"register_heading": "Подтвердите ваш адрес электронной почты",
"register_text": "Пожалуйста, используйте следующий 6-значный код подтверждения для проверки вашего адреса электронной почты",
diff --git a/packages/emails/locales/sv/emails.json b/packages/emails/locales/sv/emails.json
index 8990fb61a..94415b57d 100644
--- a/packages/emails/locales/sv/emails.json
+++ b/packages/emails/locales/sv/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "Slutdatum bokat!",
"finalizeParticipant_content2": "En kalenderinbjudan för detta evenemang bifogas.",
"finalizeParticipant_subject": "Datum bokat för {title}",
+ "login_button": "Logga in på {domain}",
"login_content2": "Du får detta e-postmeddelande eftersom en begäran gjordes för att logga in på <domain />. Om detta inte var du kan du kontakta <a>{supportEmail}</a>.",
+ "login_preview": "Använd denna länk för att logga in på denna enhet.",
+ "login_heading": "Logga in",
+ "login_content": "Ange denna 6-siffrig engångskod för verifiering:",
+ "login_codeValid": "Denna kod är giltig i 15 minuter",
+ "login_subject": "{code} är din 6-siffriga kod",
"newComment_content": "<b>{authorName}</b> har kommenterat på <b>{title}</b>.",
"newComment_subject": "{authorName} har kommenterat på {title}",
"newParticipantConfirmation_content": "Ditt svar på <b>{title}</b> har skickats.",
@@ -31,6 +37,7 @@
"newPoll_heading": "Ny förfrågan skapad",
"newPoll_button": "Hantera förfrågan",
"newPoll_subject": "Låt oss hitta ett datum för {title}!",
+ "register_footer": "Du får detta e-postmeddelande eftersom en begäran gjordes för att registrera ett konto på <domain />. Om detta inte var du, vänligen ignorera detta e-postmeddelande.",
"register_preview": "Din 6-siffriga kod är: {code}",
"register_heading": "Bekräfta din e-postadress",
"register_text": "Vänligen använd följande 6-siffriga verifieringskod för att verifiera din e-post",
@@ -55,6 +62,5 @@
"abandoned_checkout_support": "Om du har några frågor om Rallly Pro eller behöver hjälp med något alls, svara bara på detta mejl. Jag är här för att hjälpa till!",
"abandoned_checkout_preview": "Exklusivt erbjudande: Få {discount}% rabatt på ditt första år av Rallly Pro!",
"abandoned_checkout_subject": "Få {discount}% rabatt på ditt första år av Rallly Pro",
- "abandoned_checkout_signoff": "Vänliga hälsningar,",
- "license_key_plan": "Plan"
+ "abandoned_checkout_signoff": "Vänliga hälsningar,"
}
diff --git a/packages/emails/locales/zh/emails.json b/packages/emails/locales/zh/emails.json
index d6dab9227..17779b78f 100644
--- a/packages/emails/locales/zh/emails.json
+++ b/packages/emails/locales/zh/emails.json
@@ -12,7 +12,13 @@
"finalizeParticipant_heading": "最终日期已预订!",
"finalizeParticipant_content2": "请查收有关此活动的日历邀请。",
"finalizeParticipant_subject": "预订的日期为 {title}",
+ "login_button": "登录到{domain}",
"login_content2": "您收到此电子邮件是因为有人请求登录<domain />。如果这不是您,请联系<a>{supportEmail}</a>。",
+ "login_preview": "使用此链接在此设备上登录。",
+ "login_heading": "登入",
+ "login_content": "输入此一次性6位验证码:",
+ "login_codeValid": "此码有效期为15分钟",
+ "login_subject": "{code} 是您的6位代码",
"newComment_content": "<b>{authorName}</b> 在<b>{title}</b>上评论了。",
"newComment_subject": "{authorName} 对 {title} 进行了评论",
"newParticipantConfirmation_content": "您对<b>{title}</b>的回复已提交。",
@@ -31,6 +37,7 @@
"newPoll_heading": "新投票已创建",
"newPoll_button": "管理投票",
"newPoll_subject": "让我们为 {title} 找个日期!",
+ "register_footer": "您收到此电子邮件是因为有人请求在<domain />上注册账户。如果这不是您,请忽略此电子邮件。",
"register_preview": "您的6位代码是:{code}",
"register_heading": "验证您的电子邮件地址",
"register_text": "请使用以下6位验证码验证您的电子邮件",
@@ -55,7 +62,5 @@
"abandoned_checkout_support": "如果您有任何关于 Rallly Pro 的问题或需要任何帮助,只需回复这封电子邮件。我来帮忙!",
"abandoned_checkout_preview": "独家优惠:在你的第一年获得 {discount}% Rallly Pro折扣!",
"abandoned_checkout_subject": "在第一年获取 {discount}%的折扣",
- "abandoned_checkout_signoff": "向您致谢,",
- "license_key_plan": "方案",
- "license_key_nextStepsHeading": "下一步"
+ "abandoned_checkout_signoff": "向您致谢,"
}
diff --git a/packages/ui/src/alert.tsx b/packages/ui/src/alert.tsx
index a70353a3d..9274bc205 100644
--- a/packages/ui/src/alert.tsx
+++ b/packages/ui/src/alert.tsx
@@ -18,6 +18,8 @@ const alertVariants = cva(
warning:
"border-yellow-200 bg-yellow-50 text-yellow-900 has-[[data-slot=alert-description]]:text-yellow-800/90 [&>svg]:text-yellow-600",
tip: "border-green-200 bg-green-50 text-green-900 has-[[data-slot=alert-description]]:text-green-800/90 [&>svg]:text-green-600",
+ success:
+ "border-green-200 bg-green-50 text-green-900 has-[[data-slot=alert-description]]:text-green-800/90 [&>svg]:text-green-600",
note: "border-gray-200 bg-gray-50 text-gray-900 has-[[data-slot=alert-description]]:text-gray-700/90 [&>svg]:text-gray-600",
},
},