Plugin: hook-email
Sends release notifications through SMTP after a SemRel run. It can deliver version, branch, and changelog details to release managers or stakeholder mailing lists.
Installation
Section titled “Installation”Binary
Section titled “Binary”semrel plugin install @semrel/hook-emailsemrel plugin install downloads the binary to .semrel/plugins/ and updates .semrel.lock. Commit .semrel.lock to pin the version for your team.
Docker
Section titled “Docker”Pre-built, signed multi-platform images (linux/amd64, linux/arm64) are published on every release:
docker pull ghcr.io/semrels/hook-email:latestVerify the image signature with cosign:
cosign verify ghcr.io/semrels/hook-email:latest \ --certificate-identity-regexp 'https://github.com/SemRels/hook-email/.github/workflows/release.yml.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.comConfiguration
Section titled “Configuration”version: 1plugins: - uses: @semrel/hook-email args: smtp_host: smtp.example.com smtp_port: 587 smtp_user: '${{ env.SMTP_USER }}' smtp_pass: '${{ env.SMTP_PASS }}' from: 'releases@example.com' to: 'team@example.com,ops@example.com' subject_template: 'Release {{ .TagName }} is live'Environment Variables
Section titled “Environment Variables”| Name | Required | Default | Description |
|---|---|---|---|
SEMREL_PLUGIN_SMTP_HOST | yes | — | SMTP server hostname. |
SEMREL_PLUGIN_SMTP_PORT | no | 587 | SMTP server port. |
SEMREL_PLUGIN_SMTP_USER | yes | — | SMTP username. |
SEMREL_PLUGIN_SMTP_PASS | yes | — | SMTP password or app password. |
SEMREL_PLUGIN_FROM | yes | — | Sender email address. |
SEMREL_PLUGIN_TO | yes | — | Comma-separated list of recipient email addresses. |
SEMREL_PLUGIN_SUBJECT_TEMPLATE | no | plugin-defined | Optional subject template for the release email. |
SEMREL_PLUGIN_TLS | no | true | Enable or disable TLS for the SMTP connection. |
Release Context Variables
Section titled “Release Context Variables”SEMREL_TAG_NAMESEMREL_NEXT_VERSIONSEMREL_CURRENT_VERSIONSEMREL_BUMPSEMREL_BRANCHSEMREL_CHANGELOGSEMREL_DRY_RUN
Example Output
Section titled “Example Output”A successful run can send an email with a subject such as Release v1.4.0 is live and a body that includes the bump level, branch, and generated changelog.