Skip to content

feat(api): auto-send product update email on minor/major tags - #291

Merged
unjica merged 8 commits into
developfrom
feature/release-email-automation
Jul 8, 2026
Merged

unjica merged 8 commits into
developfrom
feature/release-email-automation

Conversation

@unjica

@unjica unjica commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add Release product email GitHub Actions workflow triggered on vX.Y.Z tag push; sends subscriber broadcast for minor/major bumps and skips patch-only releases.
  • Add semver helpers (release-email-semver.ts), bump check script, and --previous-version / --force flags on send-release-email.ts for CI and manual override.
  • Update MARKETING-EMAIL.md and RELEASE.md with automation details and required repository secrets.

Bugbot follow-ups (addressed)

  • Removed prisma migrate deploy from the workflow (production migrations stay manual per release runbook).
  • Previous tag resolved from --merged HEAD so older-line patch tags are not compared against a newer major.
  • Actions cache prevents duplicate sends on workflow re-run for the same tag.

Test plan

  • pnpm lint && pnpm test && pnpm build
  • release-email-semver.test.ts (patch skip, minor/major send)
  • Confirm GitHub repo secrets are set: DATABASE_URL, RESEND_API_KEY, TELEMETRY_EMAIL_FROM, TELEMETRY_DASHBOARD_ORIGIN
  • After merge: optional v1.5.0 backfill via manual --force send (see MARKETING-EMAIL.md)

Made with Cursor

unjica and others added 2 commits July 8, 2026 21:07
Add a GitHub Actions workflow that broadcasts release emails when vX.Y.Z
tags are pushed, skipping patch-only bumps. Semver helpers and script
flags support the same policy for manual override and backfill.

Co-authored-by: Cursor <[email protected]>
Drop prod migrate deploy, resolve previous tag from merged history,
and skip duplicate sends via Actions cache on re-run.

Co-authored-by: Cursor <[email protected]>
Comment thread .github/workflows/release-email.yml Resolved
Exit non-zero when fewer than all subscribers are delivered so the
Actions cache marker is not written and the workflow can be re-run.

Co-authored-by: Cursor <[email protected]>
Comment thread .github/workflows/release-email.yml Resolved
Avoid interpolating git-derived tag values into run scripts; bind them
through env and quote argv. Restrict previous-tag lookup to semver tags.

Co-authored-by: Cursor <[email protected]>
Comment thread apps/api/scripts/send-release-email.ts Resolved
unjica and others added 2 commits July 8, 2026 21:40
Record successful deliveries in MarketingReleaseEmailSend, skip
already-sent recipients on re-run, and rotate unsubscribe tokens only
after Resend confirms delivery.

Co-authored-by: Cursor <[email protected]>
TransactionClient does not expose $transaction; the release email script
always passes the root prisma client.

Co-authored-by: Cursor <[email protected]>
Comment thread apps/api/scripts/send-release-email.ts Resolved
Exit non-zero on live send with an empty list so the workflow skips
the Actions cache marker and can retry after subscribers are added.

Co-authored-by: Cursor <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8c6ecf2. Configure here.

Comment thread .github/workflows/release-email.yml Resolved
Run prisma migrate deploy in the release-email workflow so the send
script can write delivery records, and reorder RELEASE.md so manual
migrations happen before tagging on MINOR/MAJOR releases.

Co-authored-by: Cursor <[email protected]>
@unjica
unjica merged commit 9d5c5e6 into develop Jul 8, 2026
4 checks passed
@unjica
unjica deleted the feature/release-email-automation branch July 8, 2026 19:54
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.

1 participant