Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat: workspace email invites

Chadpiha875277d590b3
diff --git a/src/components/InviteTeammateDialog.tsx b/src/components/InviteTeammateDialog.tsx
index 446414a9b..05840ef42 100644
--- a/src/components/InviteTeammateDialog.tsx
+++ b/src/components/InviteTeammateDialog.tsx
@@ -95,15 +95,23 @@ export default function InviteTeammateDialog({
setSubmitting(true);
setSeatLimitSeats(null);
try {
- await InvitationsService.send(workspaceId, {
+ const result = await InvitationsService.send(workspaceId, {
email: email.trim().toLowerCase(),
role,
...(teamIds && teamIds.length > 0 ? { team_ids: teamIds } : {}),
});
- toast({
- title: t("workspaces.invite.sentTitle"),
- description: t("workspaces.invite.sentDescription", { email }),
- });
+ if (result.email_sent) {
+ toast({
+ title: t("workspaces.invite.sentTitle"),
+ description: t("workspaces.invite.sentDescription", { email }),
+ });
+ } else {
+ toast({
+ title: t("workspaces.invite.sentNoEmailTitle"),
+ description: t("workspaces.invite.sentNoEmailDescription", { email }),
+ variant: "destructive",
+ });
+ }
onInvited?.();
onOpenChange(false);
} catch (error) {
diff --git a/src/components/settings/WorkspaceMembersTab.tsx b/src/components/settings/WorkspaceMembersTab.tsx
index eceb90915..5213c2c70 100644
--- a/src/components/settings/WorkspaceMembersTab.tsx
+++ b/src/components/settings/WorkspaceMembersTab.tsx
@@ -165,9 +165,16 @@ export default function WorkspaceMembersTab({ workspace, onNavigateToBilling }:
async function handleResend(inviteId: string) {
setResendingId(inviteId);
try {
- await InvitationsService.resend(workspace.id, inviteId);
+ const { email_sent } = await InvitationsService.resend(workspace.id, inviteId);
await refreshInvitations();
- toast({ title: t("settingsPage.workspace.invites.resent") });
+ if (email_sent) {
+ toast({ title: t("settingsPage.workspace.invites.resent") });
+ } else {
+ toast({
+ title: t("settingsPage.workspace.invites.resentNoEmail"),
+ variant: "destructive",
+ });
+ }
} catch (error) {
toast({
title: t("common.error"),
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 60fd59e00..f09e59b7b 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1299,6 +1299,7 @@
"resending": "Sende erneut…",
"revoke": "Widerrufen",
"resent": "Einladung erneut gesendet",
+ "resentNoEmail": "Einladung aktualisiert, aber die E-Mail konnte nicht zugestellt werden.",
"revoked": "Einladung widerrufen",
"revokeFailed": "Einladung konnte nicht widerrufen werden",
"revokeConfirm": {
@@ -2263,6 +2264,8 @@
"submitting": "Sende…",
"sentTitle": "Einladung gesendet",
"sentDescription": "Einladung an {{email}} gesendet.",
+ "sentNoEmailTitle": "Einladung erstellt, aber nicht per E-Mail gesendet",
+ "sentNoEmailDescription": "{{email}} wurde eingeladen, aber die E-Mail konnte nicht zugestellt werden. Senden Sie sie später erneut oder teilen Sie den Einladungslink anders.",
"errorTitle": "Einladung konnte nicht gesendet werden",
"role": {
"admin": "Administrator",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 64f0c1d2e..1bf490950 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1299,6 +1299,7 @@
"resending": "Resending…",
"revoke": "Revoke",
"resent": "Invitation resent",
+ "resentNoEmail": "Invitation updated, but the email couldn't be delivered.",
"revoked": "Invitation revoked",
"revokeFailed": "Could not revoke invitation",
"revokeConfirm": {
@@ -2263,6 +2264,8 @@
"submitting": "Sending…",
"sentTitle": "Invite sent",
"sentDescription": "We sent an invitation to {{email}}.",
+ "sentNoEmailTitle": "Invite created, but not emailed",
+ "sentNoEmailDescription": "{{email}} was invited, but the email couldn't be delivered. Resend it later or share the invite link another way.",
"errorTitle": "Couldn't send invitation",
"role": {
"admin": "Admin",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index c935daec9..91965bf3b 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1961,6 +1961,7 @@
"resending": "Reenviando…",
"revoke": "Revocar",
"resent": "Invitación reenviada",
+ "resentNoEmail": "Invitación actualizada, pero no se pudo entregar el correo.",
"revoked": "Invitación revocada",
"revokeFailed": "No se pudo revocar la invitación",
"revokeConfirm": {
@@ -3240,6 +3241,8 @@
"submitting": "Enviando…",
"sentTitle": "Invitación enviada",
"sentDescription": "Enviamos una invitación a {{email}}.",
+ "sentNoEmailTitle": "Invitación creada, pero no enviada por correo",
+ "sentNoEmailDescription": "Se invitó a {{email}}, pero no se pudo entregar el correo. Reenvíalo más tarde o comparte el enlace de invitación de otra forma.",
"errorTitle": "No se pudo enviar la invitación",
"role": {
"admin": "Administrador",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 2cd5314ec..45f0e8cd9 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1299,6 +1299,7 @@
"resending": "Renvoi…",
"revoke": "Révoquer",
"resent": "Invitation renvoyée",
+ "resentNoEmail": "Invitation mise à jour, mais l'e-mail n'a pas pu être délivré.",
"revoked": "Invitation révoquée",
"revokeFailed": "Impossible de révoquer l'invitation",
"revokeConfirm": {
@@ -2263,6 +2264,8 @@
"submitting": "Envoi…",
"sentTitle": "Invitation envoyée",
"sentDescription": "Nous avons envoyé une invitation à {{email}}.",
+ "sentNoEmailTitle": "Invitation créée, mais non envoyée par e-mail",
+ "sentNoEmailDescription": "{{email}} a été invité, mais l'e-mail n'a pas pu être délivré. Renvoyez-le plus tard ou partagez le lien d'invitation autrement.",
"errorTitle": "Impossible d'envoyer l'invitation",
"role": {
"admin": "Administrateur",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 4eed7386d..9eaad957b 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1913,6 +1913,7 @@
"resending": "Reinvio…",
"revoke": "Revoca",
"resent": "Invito reinviato",
+ "resentNoEmail": "Invito aggiornato, ma non è stato possibile recapitare l'e-mail.",
"revoked": "Invito revocato",
"revokeFailed": "Impossibile revocare l'invito",
"revokeConfirm": {
@@ -3240,6 +3241,8 @@
"submitting": "Invio…",
"sentTitle": "Invito inviato",
"sentDescription": "Abbiamo inviato un invito a {{email}}.",
+ "sentNoEmailTitle": "Invito creato, ma non inviato via e-mail",
+ "sentNoEmailDescription": "{{email}} è stato invitato, ma non è stato possibile recapitare l'e-mail. Invialo di nuovo più tardi o condividi il link di invito in un altro modo.",
"errorTitle": "Impossibile inviare l'invito",
"role": {
"admin": "Amministratore",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index a9ac38094..eff3d2da9 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1913,6 +1913,7 @@
"resending": "再送信中…",
"revoke": "取り消す",
"resent": "招待を再送信しました",
+ "resentNoEmail": "招待を更新しましたが、メールを配信できませんでした。",
"revoked": "招待を取り消しました",
"revokeFailed": "招待を取り消せませんでした",
"revokeConfirm": {
@@ -3240,6 +3241,8 @@
"submitting": "送信中…",
"sentTitle": "招待を送信しました",
"sentDescription": "{{email}} に招待を送信しました。",
+ "sentNoEmailTitle": "招待を作成しましたが、メールは送信されませんでした",
+ "sentNoEmailDescription": "{{email}} を招待しましたが、メールを配信できませんでした。後で再送信するか、別の方法で招待リンクを共有してください。",
"errorTitle": "招待を送信できませんでした",
"role": {
"admin": "管理者",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index d6bd4731f..d283734aa 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1892,6 +1892,7 @@
"resending": "Reenviando…",
"revoke": "Revogar",
"resent": "Convite reenviado",
+ "resentNoEmail": "Convite atualizado, mas não foi possível entregar o e-mail.",
"revoked": "Convite revogado",
"revokeFailed": "Não foi possível revogar o convite",
"revokeConfirm": {
@@ -3240,6 +3241,8 @@
"submitting": "Enviando…",
"sentTitle": "Convite enviado",
"sentDescription": "Enviamos um convite para {{email}}.",
+ "sentNoEmailTitle": "Convite criado, mas não enviado por e-mail",
+ "sentNoEmailDescription": "{{email}} foi convidado, mas não foi possível entregar o e-mail. Reenvie-o mais tarde ou compartilhe o link de convite de outra forma.",
"errorTitle": "Não foi possível enviar o convite",
"role": {
"admin": "Administrador",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index b1f999817..c05643962 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1921,6 +1921,7 @@
"resending": "Отправка…",
"revoke": "Отозвать",
"resent": "Приглашение отправлено повторно",
+ "resentNoEmail": "Приглашение обновлено, но письмо не удалось доставить.",
"revoked": "Приглашение отозвано",
"revokeFailed": "Не удалось отозвать приглашение",
"revokeConfirm": {
@@ -3262,6 +3263,8 @@
"submitting": "Отправка…",
"sentTitle": "Приглашение отправлено",
"sentDescription": "Мы отправили приглашение на {{email}}.",
+ "sentNoEmailTitle": "Приглашение создано, но письмо не отправлено",
+ "sentNoEmailDescription": "{{email}} приглашён, но письмо не удалось доставить. Отправьте его повторно позже или поделитесь ссылкой-приглашением другим способом.",
"errorTitle": "Не удалось отправить приглашение",
"role": {
"admin": "Администратор",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 439f9c020..dbb1f7833 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1913,6 +1913,7 @@
"resending": "重新发送中…",
"revoke": "撤销",
"resent": "邀请已重新发送",
+ "resentNoEmail": "邀请已更新,但邮件无法送达。",
"revoked": "邀请已撤销",
"revokeFailed": "无法撤销邀请",
"revokeConfirm": {
@@ -3240,6 +3241,8 @@
"submitting": "发送中…",
"sentTitle": "邀请已发送",
"sentDescription": "我们已向 {{email}} 发送邀请。",
+ "sentNoEmailTitle": "邀请已创建,但未发送邮件",
+ "sentNoEmailDescription": "已邀请 {{email}},但邮件无法送达。请稍后重新发送,或通过其他方式分享邀请链接。",
"errorTitle": "无法发送邀请",
"role": {
"admin": "管理员",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 198cc052f..3cf4e00a6 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1913,6 +1913,7 @@
"resending": "重新傳送中…",
"revoke": "撤銷",
"resent": "邀請已重新傳送",
+ "resentNoEmail": "邀請已更新,但電子郵件無法送達。",
"revoked": "邀請已撤銷",
"revokeFailed": "無法撤銷邀請",
"revokeConfirm": {
@@ -3240,6 +3241,8 @@
"submitting": "傳送中…",
"sentTitle": "邀請已傳送",
"sentDescription": "我們已將邀請傳送至 {{email}}。",
+ "sentNoEmailTitle": "邀請已建立,但未傳送電子郵件",
+ "sentNoEmailDescription": "已邀請 {{email}},但電子郵件無法送達。請稍後重新傳送,或以其他方式分享邀請連結。",
"errorTitle": "無法傳送邀請",
"role": {
"admin": "管理員",
diff --git a/src/services/InvitationsService.ts b/src/services/InvitationsService.ts
index a06832108..8a6d19fb6 100644
--- a/src/services/InvitationsService.ts
+++ b/src/services/InvitationsService.ts
@@ -1,6 +1,9 @@
import { cloudGet, cloudGetPublic, cloudPost, cloudDelete, type DataWrap } from "./cloudApi.js";
import type { WorkspaceInvitation, InvitationPreview } from "../types/electron";
+// email_sent is separate because the invite row is created even when the email fails.
+type InvitationSendResult = WorkspaceInvitation & { email_sent: boolean };
+
async function list(workspaceId: string): Promise<WorkspaceInvitation[]> {
const res = await cloudGet<DataWrap<WorkspaceInvitation[]>>(
`/api/workspaces/${workspaceId}/invitations`
@@ -11,8 +14,8 @@ async function list(workspaceId: string): Promise<WorkspaceInvitation[]> {
async function send(
workspaceId: string,
input: { email: string; role?: "admin" | "member"; team_ids?: string[] }
-): Promise<WorkspaceInvitation> {
- const res = await cloudPost<DataWrap<WorkspaceInvitation>>(
+): Promise<InvitationSendResult> {
+ const res = await cloudPost<DataWrap<InvitationSendResult>>(
`/api/workspaces/${workspaceId}/invitations`,
input
);
@@ -23,8 +26,11 @@ async function revoke(workspaceId: string, invitationId: string): Promise<void>
await cloudDelete(`/api/workspaces/${workspaceId}/invitations/${invitationId}`);
}
-async function resend(workspaceId: string, invitationId: string): Promise<void> {
- await cloudPost(`/api/workspaces/${workspaceId}/invitations/${invitationId}`);
+async function resend(workspaceId: string, invitationId: string): Promise<{ email_sent: boolean }> {
+ const res = await cloudPost<DataWrap<{ resent: boolean; email_sent: boolean }>>(
+ `/api/workspaces/${workspaceId}/invitations/${invitationId}`
+ );
+ return { email_sent: res.data.email_sent };
}
async function preview(token: string): Promise<InvitationPreview> {