Skip to content

Send Email

The send-email.yml workflow fires when a GitHub Release is published. It reads the draft file generated by Draft Email and sends emails to subscribers.

This workflow uses a GitHub Actions environment (production) with required reviewers. When a release is published, the workflow starts but pauses before sending — you’ll see a yellow “Waiting for review” status in the Actions tab.

To proceed:

  1. Go to the workflow run in the Actions tab
  2. Review the draft file in the PR or repo (drafts/vX.Y.Z.md)
  3. Click Review deploymentsApprove and deploy to send emails
  4. Or click Reject to cancel

You must create the production environment in your repo settings:

  1. Go to Settings → Environments → New environment
  2. Name it production
  3. Check Required reviewers and add yourself (or your team)

Or via CLI:

Terminal window
# Get your GitHub user ID
USER_ID=$(gh api user --jq '.id')
# Create the environment with required reviewer
gh api repos/OWNER/REPO/environments/production -X PUT --input - <<EOF
{
"reviewers": [{ "type": "User", "id": $USER_ID }]
}
EOF
  1. Extracts the version from the release tag (e.g. v1.2.01.2.0)
  2. Reads drafts/v1.2.0.md from the repo (or drafts/v1.2.0-{audience}.md for multi-audience products)
  3. Sends emails via the send-file composite action
SecretDescription
FROM_EMAILSender email address
RESEND_API_KEYResend API key (if using Resend)
Subscriber store secretsDepends on your SUBSCRIBER_STORE choice

See Environment Variables for the full list.