Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ A chat button for your website, a team inbox on the web, iPhone and Android that
- **Team inbox.** In the same eleven languages. Live replies, internal notes, files, statuses, priorities, assignment and tags, across several workspaces.
- **WhatsApp, Facebook Messenger and Instagram.** Connect a website's WhatsApp Business number or Facebook Page, and customers' messages arrive in the same inbox as website chats, with the same assignment, notes and tags. Replies show when they were delivered and read, and the AI assistant can answer there too. Instagram customers get through once the business's Meta app has passed Meta's App Review ([known issues](docs/known-issues.md#instagram)).
- **The OpenChat app** for [iPhone](https://apps.apple.com/app/id6833420293) and [Android](https://play.google.com/store/apps/details?id=com.orangolabs.openchat), with notifications end-to-end encrypted to each phone, so the relay that carries them cannot read them. The app and the relay are not open source, but your installation works with them.
- **Replies by email.** A reply a website visitor has not read is emailed to them, so leaving the page does not lose the answer. A supervisor can turn it off.
- **Follow-up emails**, only with the visitor's consent, with an unsubscribe link.
- **An AI assistant that answers first**, if you turn it on. It answers visitors from your website's pages and texts you give it, and from answers it learns from your team's resolved conversations once a supervisor approves them. It hands over to a person when it cannot answer, or the visitor asks for one, and every answer is labelled AI. It runs on Workers AI in your own Cloudflare account.
- **A help centre**: articles your visitors read and search on a public page and in the widget, with views and "Was this helpful?" counts. The AI assistant answers from them too.
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const de: Messages = {
minutes: '{count} Minuten',
followUps: 'Follow-up-E-Mails',
followUpHelp: 'Wird einmal gesendet, wenn eine offene Unterhaltung so lange keine Nachricht hatte, und nur an Besucher, die eine E-Mail-Adresse angegeben und dem per Häkchen zugestimmt haben. Das Schließen des Browsers zählt nicht. Eine neue oder geänderte Regel gilt ab der nächsten Nachricht einer Unterhaltung.',
replyEmails: 'Antworten per E-Mail',
replyEmailsHelp: 'Wenn ein Besucher Ihrer Website eine Antwort Ihres Teams oder des KI-Assistenten nicht gelesen hat, wird sie ihm per E-Mail gesendet, sofern er eine Adresse angegeben hat. Ein Besucher, der den Chat verlassen hat, erhält sie nach etwa einer Minute. Wer den Chat noch geöffnet hat, erhält sie nach der Wartezeit unten, wenn sie dann noch ungelesen ist. Die E-Mail enthält nie interne Notizen oder das, was der Besucher geschrieben hat.',
replyEmailsEnable: 'Antworten per E-Mail an Besucher senden, die gegangen sind',
replyEmailsPrivacy: 'Ihre Antworten laufen dann über Ihren E-Mail-Anbieter. Prüfen Sie, ob Ihre Datenschutzerklärung das abdeckt.',
replyEmailsWait: 'Längste Wartezeit in Minuten',
replyEmailsUnavailable: 'Diese Installation kann keine E-Mails senden, daher wird nichts gesendet. Wer sie betreibt, kann E-Mail einrichten.',
ruleAfter: '{name}, nach {wait}',
ruleName: 'Name der Regel',
afterMinutes: 'Nach Minuten',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ export const en = {
minutes: '{count} minutes',
followUps: 'Follow-up emails',
followUpHelp: 'Sent once when an open conversation has had no messages for this long, only to visitors who gave an email address and ticked the box to allow it. Closing a browser does not count. A new or changed rule applies from the next message in a conversation.',
replyEmails: 'Replies by email',
replyEmailsHelp: 'When a visitor on your website has not read a reply from your team or the AI assistant, it is emailed to them, if they gave an email address. A visitor who has left the chat gets it after about a minute. One who still has the chat open gets it after the wait below, if it is still unread. The email never includes internal notes or what the visitor wrote.',
replyEmailsEnable: 'Email replies to visitors who have left',
replyEmailsPrivacy: 'Your replies then pass through your email provider. Check that your privacy notice covers it.',
replyEmailsWait: 'Longest wait, in minutes',
replyEmailsUnavailable: 'This installation cannot send email, so nothing is emailed. Whoever runs it can set email up.',
ruleAfter: '{name}, after {wait}',
ruleName: 'Rule name',
afterMinutes: 'After minutes',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const es: Messages = {
minutes: '{count} minutos',
followUps: 'Correos de seguimiento',
followUpHelp: 'Se envía una vez cuando una conversación abierta lleva este tiempo sin mensajes, solo a visitantes que dieron su correo y marcaron la casilla para permitirlo. Cerrar el navegador no cuenta. Una regla nueva o modificada se aplica desde el siguiente mensaje de cada conversación.',
replyEmails: 'Respuestas por correo',
replyEmailsHelp: 'Cuando un visitante de tu sitio web no ha leído una respuesta de tu equipo o del asistente de IA, se le envía por correo, si dio una dirección. Un visitante que ha salido del chat la recibe al cabo de un minuto, más o menos. Uno que aún tiene el chat abierto la recibe tras la espera de abajo, si sigue sin leerla. El correo nunca incluye notas internas ni lo que escribió el visitante.',
replyEmailsEnable: 'Enviar por correo las respuestas a los visitantes que se han ido',
replyEmailsPrivacy: 'Tus respuestas pasan entonces por tu proveedor de correo. Comprueba que tu aviso de privacidad lo cubre.',
replyEmailsWait: 'Espera máxima, en minutos',
replyEmailsUnavailable: 'Esta instalación no puede enviar correo, así que no se envía nada. Quien la administra puede configurarlo.',
ruleAfter: '{name}, tras {wait}',
ruleName: 'Nombre de la regla',
afterMinutes: 'Tras minutos',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const fr: Messages = {
minutes: '{count} minutes',
followUps: 'E-mails de relance',
followUpHelp: 'Envoyé une fois quand une conversation ouverte n’a eu aucun message depuis ce délai, uniquement aux visiteurs qui ont donné une adresse e-mail et coché la case pour l’accepter. Fermer le navigateur ne compte pas. Une règle nouvelle ou modifiée s’applique à partir du message suivant d’une conversation.',
replyEmails: 'Réponses par e-mail',
replyEmailsHelp: 'Quand un visiteur de votre site n’a pas lu une réponse de votre équipe ou de l’assistant IA, elle lui est envoyée par e-mail, s’il a donné une adresse. Un visiteur qui a quitté la conversation la reçoit après une minute environ. Celui qui a encore la conversation ouverte la reçoit après le délai ci-dessous, si elle n’est toujours pas lue. L’e-mail ne contient jamais de note interne ni ce que le visiteur a écrit.',
replyEmailsEnable: 'Envoyer les réponses par e-mail aux visiteurs qui sont partis',
replyEmailsPrivacy: 'Vos réponses passent alors par votre fournisseur d’e-mail. Vérifiez que votre politique de confidentialité le prévoit.',
replyEmailsWait: 'Délai maximal, en minutes',
replyEmailsUnavailable: 'Cette installation ne peut pas envoyer d’e-mails, donc rien n’est envoyé. La personne qui la gère peut configurer l’e-mail.',
ruleAfter: '{name}, après {wait}',
ruleName: 'Nom de la règle',
afterMinutes: 'Après (minutes)',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const it: Messages = {
minutes: '{count} minuti',
followUps: 'Email di follow-up',
followUpHelp: 'Inviata una volta quando una conversazione aperta non ha messaggi da questo tempo, solo ai visitatori che hanno lasciato un’email e spuntato la casella per consentirlo. Chiudere il browser non conta. Una regola nuova o modificata vale dal messaggio successivo di una conversazione.',
replyEmails: 'Risposte via email',
replyEmailsHelp: 'Quando un visitatore del tuo sito non ha letto una risposta del tuo team o dell’assistente IA, gli viene inviata via email, se ha lasciato un indirizzo. Un visitatore che ha lasciato la chat la riceve dopo circa un minuto. Chi ha ancora la chat aperta la riceve dopo l’attesa indicata sotto, se non l’ha ancora letta. L’email non contiene mai note interne né ciò che ha scritto il visitatore.',
replyEmailsEnable: 'Invia le risposte via email ai visitatori che se ne sono andati',
replyEmailsPrivacy: 'Le tue risposte passano quindi dal tuo provider email. Verifica che la tua informativa sulla privacy lo preveda.',
replyEmailsWait: 'Attesa massima, in minuti',
replyEmailsUnavailable: 'Questa installazione non può inviare email, quindi non viene inviato nulla. Chi la gestisce può configurare l’email.',
ruleAfter: '{name}, dopo {wait}',
ruleName: 'Nome della regola',
afterMinutes: 'Dopo minuti',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const ja: Messages = {
minutes: '{count} 分',
followUps: 'フォローアップメール',
followUpHelp: '対応中の会話にこの時間メッセージがないとき、メールアドレスを入力して許可にチェックした訪問者にだけ 1 回送信します。ブラウザを閉じただけでは数えません。新規や変更したルールは、会話の次のメッセージから適用されます。',
replyEmails: 'メールでの返信',
replyEmailsHelp: 'ウェブサイトの訪問者がチームや AI アシスタントの返信を読んでいない場合、メールアドレスを入力していれば、その返信をメールで送ります。チャットを離れた訪問者には約 1 分後に送ります。チャットを開いたままの訪問者には、下の待ち時間が過ぎても未読のときに送ります。メールに内部メモや訪問者が書いた内容が入ることはありません。',
replyEmailsEnable: '離れた訪問者に返信をメールで送る',
replyEmailsPrivacy: '返信はメールプロバイダーを通ることになります。プライバシーポリシーに含まれているか確認してください。',
replyEmailsWait: '最長の待ち時間(分)',
replyEmailsUnavailable: 'このインストールではメールを送信できないため、何も送られません。運用担当者がメールを設定できます。',
ruleAfter: '{name}、{wait} 後',
ruleName: 'ルール名',
afterMinutes: '経過時間(分)',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const ko: Messages = {
minutes: '{count}분',
followUps: '후속 이메일',
followUpHelp: '진행 중인 대화에 이 시간 동안 메시지가 없으면, 이메일 주소를 남기고 수신에 동의한 방문자에게만 한 번 보냅니다. 브라우저를 닫는 것은 해당하지 않습니다. 새로 만들거나 변경한 규칙은 대화의 다음 메시지부터 적용됩니다.',
replyEmails: '이메일로 답변 보내기',
replyEmailsHelp: '웹사이트 방문자가 팀이나 AI 어시스턴트의 답변을 읽지 않았고 이메일 주소를 남겼다면, 답변을 이메일로 보냅니다. 채팅을 떠난 방문자에게는 약 1분 뒤에 보냅니다. 채팅을 열어 둔 방문자에게는 아래 대기 시간이 지나도 읽지 않았을 때 보냅니다. 이메일에는 내부 메모나 방문자가 쓴 내용이 들어가지 않습니다.',
replyEmailsEnable: '떠난 방문자에게 답변을 이메일로 보내기',
replyEmailsPrivacy: '그러면 답변이 이메일 제공업체를 거치게 됩니다. 개인정보 처리방침에 포함되어 있는지 확인하세요.',
replyEmailsWait: '최대 대기 시간(분)',
replyEmailsUnavailable: '이 설치에서는 이메일을 보낼 수 없어 아무것도 보내지 않습니다. 운영자가 이메일을 설정할 수 있습니다.',
ruleAfter: '{name}, {wait} 후',
ruleName: '규칙 이름',
afterMinutes: '경과 시간(분)',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const nl: Messages = {
minutes: '{count} minuten',
followUps: 'Opvolgmails',
followUpHelp: 'Wordt één keer verstuurd als een open gesprek zo lang geen berichten heeft gehad, alleen naar bezoekers die een e-mailadres gaven en het vakje aanvinkten om dit toe te staan. Een browser sluiten telt niet. Een nieuwe of gewijzigde regel geldt vanaf het volgende bericht in een gesprek.',
replyEmails: 'Antwoorden per e-mail',
replyEmailsHelp: 'Als een bezoeker van je website een antwoord van je team of de AI-assistent niet heeft gelezen, wordt het naar hem of haar gemaild, als er een e-mailadres is opgegeven. Een bezoeker die de chat heeft verlaten, krijgt het na ongeveer een minuut. Wie de chat nog open heeft, krijgt het na de wachttijd hieronder, als het dan nog ongelezen is. De e-mail bevat nooit interne notities of wat de bezoeker schreef.',
replyEmailsEnable: 'Antwoorden mailen naar bezoekers die zijn weggegaan',
replyEmailsPrivacy: 'Je antwoorden gaan dan via je e-mailprovider. Controleer of je privacyverklaring dit dekt.',
replyEmailsWait: 'Langste wachttijd, in minuten',
replyEmailsUnavailable: 'Deze installatie kan geen e-mail versturen, dus er wordt niets gemaild. Wie haar beheert, kan e-mail instellen.',
ruleAfter: '{name}, na {wait}',
ruleName: 'Naam van de regel',
afterMinutes: 'Na minuten',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const pt: Messages = {
minutes: '{count} minutos',
followUps: 'E-mails de acompanhamento',
followUpHelp: 'Enviado uma vez quando uma conversa aberta passa esse tempo sem mensagens, só para visitantes que deram um e-mail e marcaram a caixa permitindo. Fechar o navegador não conta. Uma regra nova ou alterada vale a partir da próxima mensagem de uma conversa.',
replyEmails: 'Respostas por e-mail',
replyEmailsHelp: 'Quando um visitante do seu site não leu uma resposta da sua equipe ou do assistente de IA, ela é enviada por e-mail, se ele informou um endereço. Um visitante que saiu do chat a recebe depois de cerca de um minuto. Quem ainda está com o chat aberto a recebe depois da espera abaixo, se ainda não a leu. O e-mail nunca inclui notas internas nem o que o visitante escreveu.',
replyEmailsEnable: 'Enviar respostas por e-mail aos visitantes que saíram',
replyEmailsPrivacy: 'Suas respostas passam então pelo seu provedor de e-mail. Verifique se o seu aviso de privacidade cobre isso.',
replyEmailsWait: 'Espera máxima, em minutos',
replyEmailsUnavailable: 'Esta instalação não consegue enviar e-mail, então nada é enviado. Quem a administra pode configurar o e-mail.',
ruleAfter: '{name}, depois de {wait}',
ruleName: 'Nome da regra',
afterMinutes: 'Depois de minutos',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const zhHans: Messages = {
minutes: '{count} 分钟',
followUps: '跟进邮件',
followUpHelp: '当进行中的会话在这么长时间内没有消息时发送一次,只发给留下邮箱并勾选同意的访客。关闭浏览器不算。新增或修改的规则从会话的下一条消息开始生效。',
replyEmails: '通过邮件发送回复',
replyEmailsHelp: '当网站访客没有读到团队或 AI 助手的回复,而且留下了邮箱时,回复会通过邮件发给他们。已离开聊天的访客大约一分钟后收到。仍开着聊天的访客,在下面的等待时间过后仍未读时收到。邮件绝不包含内部备注或访客写的内容。',
replyEmailsEnable: '把回复通过邮件发给已离开的访客',
replyEmailsPrivacy: '这样你的回复会经过你的邮件服务商。请确认你的隐私声明已涵盖这一点。',
replyEmailsWait: '最长等待时间(分钟)',
replyEmailsUnavailable: '此安装无法发送邮件,因此不会发送任何内容。运营者可以设置邮件。',
ruleAfter: '{name},{wait}后',
ruleName: '规则名称',
afterMinutes: '间隔分钟',
Expand Down
6 changes: 6 additions & 0 deletions apps/dashboard/src/i18n/zh-hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ export const zhHant: Messages = {
minutes: '{count} 分鐘',
followUps: '後續郵件',
followUpHelp: '當處理中的對話這麼久沒有訊息時寄出一次,只寄給留下電子郵件並勾選同意的訪客。關閉瀏覽器不算。新增或變更的規則從對話的下一則訊息開始套用。',
replyEmails: '以電子郵件傳送回覆',
replyEmailsHelp: '當網站訪客沒有讀到團隊或 AI 助理的回覆,而且留下了電子郵件時,回覆會以電子郵件寄給他們。已離開對話的訪客約一分鐘後收到。仍開著對話的訪客,在下方等待時間過後仍未讀時收到。電子郵件絕不包含內部備註或訪客寫的內容。',
replyEmailsEnable: '把回覆以電子郵件寄給已離開的訪客',
replyEmailsPrivacy: '這樣你的回覆會經過你的電子郵件服務商。請確認你的隱私權聲明已涵蓋這一點。',
replyEmailsWait: '最長等待時間(分鐘)',
replyEmailsUnavailable: '此安裝無法傳送電子郵件,因此不會寄出任何內容。營運者可以設定電子郵件。',
ruleAfter: '{name},{wait}後',
ruleName: '規則名稱',
afterMinutes: '間隔分鐘',
Expand Down
41 changes: 40 additions & 1 deletion apps/dashboard/src/pages/email-panels.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Email settings for supervisors: follow-up rules, and addresses not to email. */
import type { FollowUpRule } from '@openchat/api-client';
import type { FollowUpRule, ReplyEmailSettings } from '@openchat/api-client';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useState } from 'react';
import { api, errorMessage } from '../app-context';
Expand Down Expand Up @@ -40,6 +40,45 @@ export function SuppressionsPanel({ workspaceId }: { workspaceId: string }) {
);
}

/** For supervisors. The team's unread replies, emailed to visitors who have left (ADR-0029). */
export function ReplyEmailsPanel({ workspaceId }: { workspaceId: string }) {
const client = useQueryClient();
const key = ['reply-emails', workspaceId];
const settings = useQuery({ queryKey: key, queryFn: () => api.getReplyEmailSettings(workspaceId) });
const save = useMutation({
mutationFn: (input: { enabled: boolean; waitMinutes: number }) => api.updateReplyEmailSettings(workspaceId, input),
onSuccess: (data: ReplyEmailSettings) => { client.setQueryData(key, data); setWait(null); },
});
const [wait, setWait] = useState<string | null>(null);
const data = settings.data;
const failure = settings.error ?? save.error;
return (
<section className="card space-y-3" aria-label={t('replyEmails')}>
<h2 className="font-medium">{t('replyEmails')}</h2>
<p className="text-xs text-slate-600 dark:text-slate-400">{t('replyEmailsHelp')}</p>
{failure ? <p className="error" role="alert">{errorMessage(failure)}</p> : null}
{data && !data.available ? <p className="text-sm">{t('replyEmailsUnavailable')}</p> : null}
{data ? (
<>
<label className="flex items-start gap-2 text-sm">
<input type="checkbox" className="mt-0.5" checked={save.isPending ? save.variables.enabled : data.enabled} disabled={save.isPending} onChange={(event) => save.mutate({ enabled: event.target.checked, waitMinutes: data.waitMinutes })} aria-describedby="reply-emails-privacy" />
<span>
<span className="font-medium">{t('replyEmailsEnable')}</span>
<span id="reply-emails-privacy" className="block text-xs text-slate-600 dark:text-slate-400">{t('replyEmailsPrivacy')}</span>
</span>
</label>
<form className="flex flex-wrap items-end gap-2" onSubmit={(event) => { event.preventDefault(); save.mutate({ enabled: data.enabled, waitMinutes: Number(wait ?? data.waitMinutes) }); }}>
<label className="w-48 text-sm">{t('replyEmailsWait')}
<input className="field" type="number" required min={1} max={1440} value={wait ?? String(data.waitMinutes)} onChange={(event) => setWait(event.target.value)} />
</label>
<button className="button" disabled={save.isPending || wait === null || Number(wait) === data.waitMinutes}>{t('save')}</button>
</form>
</>
) : null}
</section>
);
}

const describeWait = (minutes: number) => (minutes % 60 === 0 ? tn('hours', minutes / 60) : t('minutes', { count: minutes }));

/** For supervisors. */
Expand Down
Loading
Loading