← メール履歴一覧

Re: [CSplus/RelationshipCRM] feat: EmailCampaign メール配信機能 (PR #14)

受信Gmail同期2026/07/12 1:34
編集

未紐付けのメールです

連絡先を選択して紐付けると、連絡先・会社のメール履歴に表示されます

相手(連絡先)
-
会社
-
From(Gmail)
notifications@github.com
To / Cc(Gmail)
relationshipcrm@noreply.github.com, koshiba@csplus.jp, author@noreply.github.com
作成日時
2026/07/12 11:08
更新日時
2026/07/12 11:08

本文

@chatgpt-codex-connector[bot] commented on this pull request. ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `70e53d29eb` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details> > + const raw = buildRawMessage({ from: fromAddress, to, subject, body }); + const result = await api.sendRaw(raw); **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Claim recipients before calling Gmail** When two batch executions for the same campaign run outside the same Node process (for example multiple server replicas or a retry that does not share the in-memory `processingCampaigns` set), both can read the same `PENDING` recipient and both call `api.sendRaw` here before the later `updateMany(... status: "PENDING")` detects that one lost the race. The loser rolls back its DB changes, but the email has already been delivered, so customers can receive duplicate campaign mail; claim/transition the row atomically before sending, or use a DB-level lock/status. Useful? React with 👍 / 👎. > + const recipients = await prisma.emailCampaignRecipient.findMany({ + where: { campaignId, status: "PENDING" }, + include: { contact: { include: { company: true } } }, **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Recheck opt-outs at send time** For draft or scheduled campaigns, a contact can be marked `emailOptOut` after the campaign is created but before it is sent; this query still loads every `PENDING` recipient and the loop sends to the stored address without checking `recipient.contact.emailOptOut`. That bypasses the opt-out flag for delayed sends, so recipients who unsubscribed after preview/creation can still be emailed; filter or mark them `SKIPPED` immediately before `sendRaw`. Useful? React with 👍 / 👎. -- Reply to this email directly or view it on GitHub: https://github.com/CSplus/RelationshipCRM/pull/14#pullrequestreview-4678329854 You are receiving this because you authored the thread. Message ID: <CSplus/RelationshipCRM/pull/14/review/4678329854@github.com>