Skip to content

お問い合わせをサイト自身で受け付け、[email protected] から返信する - #53

Open
FORIFOR wants to merge 7 commits into
mainfrom
feat/inquiry-in-reachmade
Open

FORIFOR wants to merge 7 commits into
mainfrom
feat/inquiry-in-reachmade

Conversation

@FORIFOR

@FORIFOR FORIFOR commented Nov 11, 2026

Copy link
Copy Markdown
Owner

概要

reachmade.com のお問い合わせを、AI Meeting のサーバー(Google Cloud Run)への転送から、このサイトの Worker と D1 での受付に切り替えます。運営者はお問い合わせごとの返信ページから、[email protected] で返信できます。

本番には反映済みです(2026-11-11、npm run deploy)。この PR は main をその状態に合わせるためのものです。

変更

  • 受付:/api/inquiries が D1(reachmade-inquiries、migrations/0001_inquiries.sql)に保存します。他サービスへの転送はしません。受付番号は RM-(フォームは従来の AM- も受け付けます)。入力の検証、同一オリジンの確認、1日100件・同じアドレス1日3件の上限は従来どおりで、上限は1文の upsert にして同時送信でも超えないようにしています。
  • 通知:Resend で運営者へ。お問い合わせ全文と、お問い合わせごとに署名した返信ページへのリンク(30日有効)が入ります。Reply-To は付けません(個人の受信箱から返信して個人アドレスが相手に見えるのを防ぐため)。
  • 返信ページ /inquiries/reply/<id>?exp&sig:お問い合わせを表示して返信を送ります。送信元は Reachmade <[email protected]>、Reply-To は INQUIRY_REPLY_TO([email protected])。noindex・no-store、スクリプトなし、他サイトからの送信は拒否、二度押しや再送でも1通、送信失敗時は下書きを残します。1件あたり20通まで。
  • 保存期間:90日。毎日 1 回の cron(UTC 18:17)で期限切れの問い合わせ・返信・古い上限カウンタを削除します。
  • 文言:プライバシーページと同意文の保存先を「Google Cloud」から「Cloudflare」に、返信が Resend 経由で [email protected] から届くことを追記しました。
  • 設定:wrangler.jsonc に D1 バインディング、cron、INQUIRY_REPLY_TO。秘密の値(RESEND_API_KEY、INQUIRY_NOTIFY_TO、INQUIRY_REPLY_SECRET)は wrangler secret で登録済み。手順と運用は docs/INQUIRIES.ja.md。

この PR には、main にまだ入っていなかった作業ブランチ feat/inquiry-notice-privacy の 4 コミット(Noa のページ、Genie のプライバシーページなど)も含まれます。今回の変更はその上に作っています。

確認したこと

  • npm run check:527/527 合格。D1 の代わりに Node の SQLite へ実際のマイグレーションを当てて、保存・再送・上限・削除・返信の予約と取り消しを確認しています。
  • 実ブラウザー(ローカル):相談フォーム送信 → 通知の作成 → リンクから返信、をパソコン幅・スマホ幅で確認。scripts/verify-inquiry-form.py も合格。
  • 本番:reachmade.com からテストのお問い合わせ(RM-E8249CF3)を送り、受付・通知・返信([email protected] から、Reply-To pw@)がいずれも Resend で Delivered。テストのデータは削除済み。

未確認

  • Gmail での受信箱・迷惑メールの振り分け(Resend では Delivered)。
  • ui-reviewer による返信ページの独立レビュー。

Generated by Claude Code

FORIFOR and others added 7 commits October 21, 2026 01:48
Three bilingual pages under /products/noa/ (contact, sponsor, games),
each ending at the site's one inquiry form with its own context and
template. The intake has no Noa category, so they file as custom.
Sponsor-slot facts come from the ledger (checked against the studio's
SPONSOR_OVERLAY.md); no audience figures or prices. The Noa product
page links to all three from its consult band.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… page

Needed for the Google OAuth consent screen (homepage + privacy policy).
Text follows the Genie code: tokens in the macOS Keychain, Google Limited Use,
what goes to AI providers, and the LINE relay's retention.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Da8zskT4bTyi5Zru5H2hZY
…made.com

Inquiries were forwarded to the AI Meeting broker on Google Cloud. They are
now stored in this Worker's D1 database (migrations/0001_inquiries.sql) and
announced to the operator through Resend. The notice links to a signed,
per-inquiry reply page on reachmade.com; replies go out from
[email protected] with Reply-To the operator's inbox, so the visitor
never sees a personal address, and the notice itself has no Reply-To.

- Same validation, origin checks and daily limits as before (100/day,
  3 per email), as single-statement upserts so concurrent posts cannot pass.
- Receipts start RM-; the form still accepts AM- receipts.
- 90-day retention with a daily cron cleanup.
- Privacy page and consent text now name Cloudflare and reply delivery.
- Fails closed: status and intake stay unavailable until D1 and the
  notice are configured (docs/INQUIRIES.ja.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFsCni8MoaZSbRpevCRgG
A no-reply sender reads as "do not answer" and is flagged by Resend's
deliverability check. Replies already set Reply-To to the operator inbox;
the sender now matches that intent. Texts naming the address follow
INQUIRY_MAIL_FROM.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFsCni8MoaZSbRpevCRgG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants