Send real email from GitHub Actions workflows using AgenticMail.
Drop-in step that POSTs to your AgenticMail HTTP API. Works with a self-hosted instance (default http://127.0.0.1:3100) or any reachable AgenticMail deployment. Authenticates with a per-agent API key.
name: Notify on release
on:
release:
types: [published]
jobs:
email:
runs-on: ubuntu-latest
steps:
- uses: agenticmail/send-email-action@v1
with:
api-key: ${{ secrets.AGENTICMAIL_API_KEY }}
api-url: https://mail.example.com # your AgenticMail API base
to: team@example.com
subject: "New release: ${{ github.event.release.tag_name }}"
text: |
${{ github.event.release.name }} is out.
${{ github.event.release.html_url }}| Name | Required | Default | Description |
|---|---|---|---|
api-key |
yes | — | Per-agent AgenticMail API key. Store as a repo/org secret. |
api-url |
no | http://127.0.0.1:3100 |
Base URL of your AgenticMail HTTP API. |
to |
yes | — | Recipient address(es). Comma-separated for multiple. |
subject |
yes | — | Email subject. |
text |
no* | — | Plain-text body. |
html |
no* | — | HTML body. |
cc |
no | — | CC recipient(s). Comma-separated. |
bcc |
no | — | BCC recipient(s). Comma-separated. |
reply-to |
no | — | Reply-To address. |
* At least one of text or html is required.
| Name | Description |
|---|---|
message-id |
RFC 5322 Message-ID of the sent email (if returned). |
response |
Raw JSON response body from AgenticMail. |
- uses: agenticmail/send-email-action@v1
with:
api-key: ${{ secrets.AGENTICMAIL_API_KEY }}
to: alice@example.com, bob@example.com
cc: ops@example.com
subject: Build green
text: All checks passed.- uses: agenticmail/send-email-action@v1
with:
api-key: ${{ secrets.AGENTICMAIL_API_KEY }}
to: ${{ github.event.pull_request.user.email }}
subject: PR merged — thanks!
html: |
<p>Your PR <a href="${{ github.event.pull_request.html_url }}">#${{ github.event.pull_request.number }}</a> has shipped. 🎉</p>If you don't have AgenticMail running yet, see the main repo. Quick start: npx @agenticmail/cli init then npx @agenticmail/cli serve. Tunnel the API to a public host (Cloudflare/ngrok) so GitHub Actions runners can reach it, and pass that URL via api-url.
- The API key is sent as
Authorization: Bearer <key>. Always store it as a GitHub secret. - AgenticMail runs an outbound security guard server-side (PII scanners, sensitive-content detection). Emails that trip the guard go to a human-in-the-loop approval queue and the action will exit non-zero. Use a dedicated agent key in CI so review trails stay scoped.
- The action uses
jqfor JSON encoding so subjects/bodies with special characters are safely escaped.jqis preinstalled onubuntu-latestandmacos-latestrunners; onwindows-latest, install jq first (e.g.choco install jq).
MIT — see LICENSE.