diff --git a/apps/remix/app/components/MailList.tsx b/apps/remix/app/components/MailList.tsx index 7aefff1..e4660a0 100644 --- a/apps/remix/app/components/MailList.tsx +++ b/apps/remix/app/components/MailList.tsx @@ -85,9 +85,9 @@ export function MailList(props: { mails: Email[] }) { -
+
{data.length === 0 && ( -
+

{t("Waiting for emails...")}

diff --git a/apps/remix/app/components/sender.tsx b/apps/remix/app/components/sender.tsx index 673f832..b70cb70 100644 --- a/apps/remix/app/components/sender.tsx +++ b/apps/remix/app/components/sender.tsx @@ -7,6 +7,7 @@ import { } from "react"; import Modal from "./modal"; import { Form, useNavigation } from "@remix-run/react"; +import { useTranslation } from "react-i18next"; export default function SenderModal({ senderEmail, @@ -18,25 +19,22 @@ export default function SenderModal({ setShowSenderModal: Dispatch>; }) { const navigation = useNavigation(); + const { t } = useTranslation(); return ( -
+
-

Send email

-

Forward only, no storage

-

- ⚠️Please do not send illegal content such as politics, pornography, - etc -

+

Vmail Sender

+

{t("Forward only, no storage")}

-
-
+ +
+
+ +
+ +
-
- -
-
- -
-
+
-
+
-
-
- + className="min-h-24 p-2 border border-slate-200 shadow-inner rounded-md w-full">
+ + +

+ 🚫 + {t( + "Please do not send illegal content such as politics, pornography, etc" + )} + . +

diff --git a/apps/remix/app/routes/_h._index.tsx b/apps/remix/app/routes/_h._index.tsx index cadbef3..113c51c 100644 --- a/apps/remix/app/routes/_h._index.tsx +++ b/apps/remix/app/routes/_h._index.tsx @@ -69,6 +69,7 @@ export const action: ActionFunction = async ({ request }) => { ((await userMailboxCookie.parse( request.headers.get("Cookie") )) as string) || undefined; + const sendWorkerUrl = process.env.SEND_WORKER_URL || ""; if (_action === "stop") { if (IuserMailbox) { @@ -81,32 +82,32 @@ export const action: ActionFunction = async ({ request }) => { }); } } else if (_action === "create") { - // const response = (await request.formData()).get("cf-turnstile-response"); - // if (!response) { - // return { - // error: "No captcha response", - // }; - // } - // const verifyEndpoint = - // "https://challenges.cloudflare.com/turnstile/v0/siteverify"; - // const secret = - // process.env.TURNSTILE_SECRET || "1x0000000000000000000000000000000AA"; - // const resp = await fetch(verifyEndpoint, { - // method: "POST", - // body: JSON.stringify({ - // secret, - // response, - // }), - // headers: { - // "Content-Type": "application/json", - // }, - // }); - // const data = await resp.json(); - // if (!data.success) { - // return { - // error: "Failed to verify captcha", - // }; - // } + const response = (await request.formData()).get("cf-turnstile-response"); + if (!response) { + return { + error: "No captcha response", + }; + } + const verifyEndpoint = + "https://challenges.cloudflare.com/turnstile/v0/siteverify"; + const secret = + process.env.TURNSTILE_SECRET || "1x0000000000000000000000000000000AA"; + const resp = await fetch(verifyEndpoint, { + method: "POST", + body: JSON.stringify({ + secret, + response, + }), + headers: { + "Content-Type": "application/json", + }, + }); + const data = await resp.json(); + if (!data.success) { + return { + error: "Failed to verify captcha", + }; + } const domain = process.env.EMAIL_DOMAIN || ""; if (!domain) { @@ -122,8 +123,8 @@ export const action: ActionFunction = async ({ request }) => { "Set-Cookie": userMailbox, }, }); - } else if (_action === "send") { - const res = await fetch(process.env.SEND_WORKER_URL || "", { + } else if (_action === "send" && sendWorkerUrl) { + const res = await fetch(sendWorkerUrl, { method: "POST", headers: { "Content-Type": "application/json", @@ -131,7 +132,7 @@ export const action: ActionFunction = async ({ request }) => { body: JSON.stringify({ from: { email: IuserMailbox, - name: formData.get("senderName") as string, + name: formData.get("senderName") || "Anonymous", }, personalizations: [ { @@ -152,9 +153,12 @@ export const action: ActionFunction = async ({ request }) => { ], }), }); - console.log("[res]", res); - - return redirect("/", {}); + console.log("[res]", res.status); + return redirect("/"); + } else { + return { + error: "Invalid action", + }; } }; @@ -215,6 +219,15 @@ export default function Index() { className="py-2.5 rounded-md w-full bg-cyan-600 hover:opacity-90 disabled:cursor-not-allowed disabled:bg-zinc-500"> {t("Stop")} + +
+ {t("Vmail sender is beta now. ")} + setShowSenderModal(true)} + className="text-cyan-500 cursor-pointer"> + {t("Try it")}. + +
)} @@ -240,6 +253,9 @@ export default function Index() { className="py-2.5 rounded-md w-full bg-cyan-600 hover:opacity-90 disabled:cursor-not-allowed disabled:bg-zinc-500"> {t("Create temporary email")} +

+ Vmail can now send emails! +

)}
@@ -247,8 +263,6 @@ export default function Index() {
{t(actionData.error)}
)}
- -
diff --git a/apps/remix/public/locales/de/common.json b/apps/remix/public/locales/de/common.json index 57d6e9f..44a885e 100644 --- a/apps/remix/public/locales/de/common.json +++ b/apps/remix/public/locales/de/common.json @@ -16,5 +16,15 @@ "About": "Über", "Privacy": "Datenschutz", "INBOX": "POSTEINGANG", - "Waiting for emails...": "Warte auf E-Mails..." + "Waiting for emails...": "Warte auf E-Mails...", + "Try it": "Ausprobieren", + "Forward only, no storage": "Nur weiterleiten, keine Speicherung", + "Sending email *": "E-Mail senden *", + "Sending name": "Senden von Name", + "Recipient email *": "Empfänger-E-Mail *", + "Email subject *": "E-Mail-Betreff *", + "Email content *": "E-Mail-Inhalt *", + "Sending...": "Senden...", + "Send": "Senden", + "Please do not send illegal content such as politics, pornography, etc": "Bitte senden Sie keine illegalen Inhalte wie Politik, Pornografie, usw." } diff --git a/apps/remix/public/locales/en/common.json b/apps/remix/public/locales/en/common.json index 1be6c37..737a44c 100644 --- a/apps/remix/public/locales/en/common.json +++ b/apps/remix/public/locales/en/common.json @@ -16,5 +16,15 @@ "About": "About", "Privacy": "Privacy", "INBOX": "INBOX", - "Waiting for emails...": "Waiting for emails..." + "Waiting for emails...": "Waiting for emails...", + "Try it": "Try it", + "Forward only, no storage": "Forward only, no storage", + "Sending email *": "Sending email *", + "Sending name": "Sending name", + "Recipient email *": "Recipient email *", + "Email subject *": "Email subject *", + "Email content *": "Email content *", + "Sending...": "Sending...", + "Send": "Send", + "Please do not send illegal content such as politics, pornography, etc": "Please do not send illegal content such as politics, pornography, etc" } diff --git a/apps/remix/public/locales/fr/common.json b/apps/remix/public/locales/fr/common.json index 599dce5..a608f9f 100644 --- a/apps/remix/public/locales/fr/common.json +++ b/apps/remix/public/locales/fr/common.json @@ -16,5 +16,15 @@ "About": "À propos", "Privacy": "Vie privée", "INBOX": "BOÎTE DE RECEPTION", - "Waiting for emails...": "En attente de courriels..." + "Waiting for emails...": "En attente de courriels...", + "Try it": "Essayer", + "Forward only, no storage": "Transférer uniquement, pas de stockage", + "Sending email *": "Envoyer un email *", + "Sending name": "Nom d'envoi", + "Recipient email *": "Email du destinataire *", + "Email subject *": "Objet de l'email *", + "Email content *": "Contenu de l'email *", + "Sending...": "Envoi en cours...", + "Send": "Envoyer", + "Please do not send illegal content such as politics, pornography, etc": "Veuillez ne pas envoyer de contenu illégal tel que de la politique, de la pornographie, etc." } diff --git a/apps/remix/public/locales/hi/common.json b/apps/remix/public/locales/hi/common.json index 0405746..cc8556c 100644 --- a/apps/remix/public/locales/hi/common.json +++ b/apps/remix/public/locales/hi/common.json @@ -16,5 +16,15 @@ "About": "के बारे में", "Privacy": "गोपनीयता", "INBOX": "इनबॉक्स", - "Waiting for emails...": "ईमेल की प्रतीक्षा कर रहा है..." + "Waiting for emails...": "ईमेल की प्रतीक्षा कर रहा है...", + "Try it": "इसे प्रयास करें", + "Forward only, no storage": "केवल आगे भेजें, कोई संग्रहण नहीं", + "Sending email *": "ईमेल भेजना *", + "Sending name": "भेजने वाले का नाम", + "Recipient email *": "प्राप्तकर्ता ईमेल *", + "Email subject *": "ईमेल विषय *", + "Email content *": "ईमेल की सामग्री *", + "Sending...": "भेज रहा है...", + "Send": "भेजें", + "Please do not send illegal content such as politics, pornography, etc": "कृपया राजनीति, अश्लीलता आदि जैसी अवैध सामग्री न भेजें" } diff --git a/apps/remix/public/locales/it/common.json b/apps/remix/public/locales/it/common.json index 720468f..c8fc077 100644 --- a/apps/remix/public/locales/it/common.json +++ b/apps/remix/public/locales/it/common.json @@ -16,5 +16,15 @@ "About": "Informazioni", "Privacy": "Privacy", "INBOX": "INBOX", - "Waiting for emails...": "In attesa di email..." + "Waiting for emails...": "In attesa di email...", + "Try it": "Provalo", + "Forward only, no storage": "Solo inoltra, nessuna archiviazione", + "Sending email *": "Invio email *", + "Sending name": "Nome invio", + "Recipient email *": "Email del destinatario *", + "Email subject *": "Oggetto dell'email *", + "Email content *": "Contenuto dell'email *", + "Sending...": "Inviando...", + "Send": "Invia", + "Please do not send illegal content such as politics, pornography, etc": "Si prega di non inviare contenuti illegali come politica, pornografia, ecc." } diff --git a/apps/remix/public/locales/ja/common.json b/apps/remix/public/locales/ja/common.json index 8cd48a2..146b2e8 100644 --- a/apps/remix/public/locales/ja/common.json +++ b/apps/remix/public/locales/ja/common.json @@ -16,5 +16,15 @@ "About": "について", "Privacy": "プライバシー", "INBOX": "インボックス", - "Waiting for emails...": "メールを待っています..." + "Waiting for emails...": "メールを待っています...", + "Try it": "試してみる", + "Forward only, no storage": "転送のみ、保存なし", + "Sending email *": "メールの送信 *", + "Sending name": "送信者名", + "Recipient email *": "受信者のメールアドレス *", + "Email subject *": "メールの件名 *", + "Email content *": "メールの内容 *", + "Sending...": "送信中...", + "Send": "送信", + "Please do not send illegal content such as politics, pornography, etc": "政治、ポルノなどの違法なコンテンツを送信しないでください" } diff --git a/apps/remix/public/locales/ko/common.json b/apps/remix/public/locales/ko/common.json index 97fc0ea..08ca52f 100644 --- a/apps/remix/public/locales/ko/common.json +++ b/apps/remix/public/locales/ko/common.json @@ -16,5 +16,15 @@ "About": "소개", "Privacy": "개인정보", "INBOX": "인박스", - "Waiting for emails...": "이메일 기다리는 중..." + "Waiting for emails...": "이메일 기다리는 중...", + "Try it": "시도해 보세요", + "Forward only, no storage": "전달만, 저장 없음", + "Sending email *": "이메일 보내기 *", + "Sending name": "보내는 이름", + "Recipient email *": "수신자 이메일 *", + "Email subject *": "이메일 제목 *", + "Email content *": "이메일 내용 *", + "Sending...": "전송 중...", + "Send": "보내기", + "Please do not send illegal content such as politics, pornography, etc": "정치, 음란물 등과 같은 불법 콘텐츠를 보내지 마십시오" } diff --git a/apps/remix/public/locales/pt/common.json b/apps/remix/public/locales/pt/common.json index 5e0077c..c25d3ff 100644 --- a/apps/remix/public/locales/pt/common.json +++ b/apps/remix/public/locales/pt/common.json @@ -16,5 +16,15 @@ "About": "Sobre", "Privacy": "Privacidade", "INBOX": "CAIXA DE ENTRADA", - "Waiting for emails...": "Aguardando e-mails..." + "Waiting for emails...": "Aguardando e-mails...", + "Try it": "Experimente", + "Forward only, no storage": "Apenas encaminhar, sem armazenamento", + "Sending email *": "Enviar e-mail *", + "Sending name": "Nome do remetente", + "Recipient email *": "Email do destinatário *", + "Email subject *": "Assunto do email *", + "Email content *": "Conteúdo do email *", + "Sending...": "Enviando...", + "Send": "Enviar", + "Please do not send illegal content such as politics, pornography, etc": "Por favor, não envie conteúdo ilegal como política, pornografia, etc." } diff --git a/apps/remix/public/locales/ru/common.json b/apps/remix/public/locales/ru/common.json index 1932d5d..baced1c 100644 --- a/apps/remix/public/locales/ru/common.json +++ b/apps/remix/public/locales/ru/common.json @@ -16,5 +16,15 @@ "About": "О нас", "Privacy": "Конфиденциальность", "INBOX": "ВХОДЯЩИЕ", - "Waiting for emails...": "Ожидание писем..." + "Waiting for emails...": "Ожидание писем...", + "Try it": "Попробуйте", + "Forward only, no storage": "Только пересылка, без сохранения", + "Sending email *": "Отправка электронной почты *", + "Sending name": "Имя отправителя", + "Recipient email *": "Адресат электронной почты *", + "Email subject *": "Тема письма *", + "Email content *": "Содержимое письма *", + "Sending...": "Отправка...", + "Send": "Отправить", + "Please do not send illegal content such as politics, pornography, etc": "Пожалуйста, не отправляйте незаконный контент, такой как политика, порнография и т. д." } diff --git a/apps/remix/public/locales/tr/common.json b/apps/remix/public/locales/tr/common.json index 6f5f463..8d7e512 100644 --- a/apps/remix/public/locales/tr/common.json +++ b/apps/remix/public/locales/tr/common.json @@ -16,5 +16,15 @@ "About": "Hakkında", "Privacy": "Gizlilik", "INBOX": "GİRİŞ", - "Waiting for emails...": "E-Postalar Bekleniyor..." + "Waiting for emails...": "E-Postalar Bekleniyor...", + "Try it": "Deneyin", + "Forward only, no storage": "Sadece ileri, depolama yok", + "Sending email *": "E-posta gönderme *", + "Sending name": "Gönderen adı", + "Recipient email *": "Alıcı e-posta *", + "Email subject *": "E-posta konusu *", + "Email content *": "E-posta içeriği *", + "Sending...": "Gönderiliyor...", + "Send": "Gönder", + "Please do not send illegal content such as politics, pornography, etc": "Lütfen siyaset, pornografi vb. gibi yasa dışı içerikler göndermeyin" } diff --git a/apps/remix/public/locales/zh-TW/common.json b/apps/remix/public/locales/zh-TW/common.json index e237f4c..4b72613 100644 --- a/apps/remix/public/locales/zh-TW/common.json +++ b/apps/remix/public/locales/zh-TW/common.json @@ -16,5 +16,15 @@ "About": "關於", "Privacy": "隱私政策", "INBOX": "收件匣", - "Waiting for emails...": "等待電子郵件..." + "Waiting for emails...": "等待電子郵件...", + "Try it": "試試看", + "Forward only, no storage": "僅轉發,不儲存", + "Sending email *": "發送電子郵件 *", + "Sending name": "發件人姓名", + "Recipient email *": "收件者電子郵件 *", + "Email subject *": "電子郵件主題 *", + "Email content *": "電子郵件內容 *", + "Sending...": "發送中...", + "Send": "發送", + "Please do not send illegal content such as politics, pornography, etc": "請不要發送政治、色情等非法內容" } diff --git a/apps/remix/public/locales/zh/common.json b/apps/remix/public/locales/zh/common.json index e07468c..75ee89b 100644 --- a/apps/remix/public/locales/zh/common.json +++ b/apps/remix/public/locales/zh/common.json @@ -16,5 +16,16 @@ "About": "关于", "Privacy": "隐私", "INBOX": "INBOX", - "Waiting for emails...": "准备接收邮件..." + "Waiting for emails...": "准备接收邮件...", + "Vmail sender is beta now. ": "Vmail 发信公测中,", + "Try it": "试试匿名发件", + "Forward only, no storage": "仅转发,不存储", + "Sending email *": "发送电子邮件 *", + "Sending name": "发件人昵称", + "Recipient email *": "收件人电子邮件 *", + "Email subject *": "电子邮件主题 *", + "Email content *": "电子邮件内容 *", + "Sending...": "正在发送...", + "Send": "发送", + "Please do not send illegal content such as politics, pornography, etc": "请勿发送涉政、色情等违法内容" }