Skip to content

Email Agent

The email agent sends pipeline notifications via SMTP. It is a notify-only agent — you don’t put it in a phase’s agent: field. Instead, it fires when pipeline events trigger from notify blocks or the notifications configuration.

Use the email agent when your team needs notifications outside of Slack, or when stakeholders prefer email for audit trails and formal communication.


- name: implement
agent: cursor
role: developer
notify:
on_complete:
agent: email
channel: team

The email agent cannot be used as a workflow phase agent. It has no action field, no sources, and no target_entries. It activates exclusively through notify blocks on other phases.

FieldTypeRequiredDescription
agentstringYesMust be "email"
channelstringNoChannel name from settings (defaults to "default")
subjectstringNoEmail subject line

Supported events: on_complete, on_escalate, on_fail.

  • "email" or channel: default — routes to the default recipient list
  • channel: oncall — routes to the named oncall channel

Configure under agents.email in settings.json (via cliq setup or cliq settings):

KeyRequiredDefaultDescription
agents.email.smtp_hostYesSMTP server hostname
agents.email.smtp_portNo587SMTP server port
agents.email.usernameNoSMTP authentication username
agents.email.passwordNoSMTP authentication password
agents.email.tlsNotrueEnable TLS encryption
agents.email.from_addressNoSender email address
agents.email.from_nameNo"cliq"Sender display name
agents.email.channelsYesNamed channel map (must include at least default)
agents.email.channels.defaultYesArray of default recipient email addresses
agents.email.channels.<name>NoNamed recipient list

Channels are named groups of recipients. Every email agent configuration must include at least a default channel:

{
"agents": {
"email": {
"smtp_host": "smtp.example.com",
"smtp_port": 587,
"username": "[email protected]",
"password": "app-password-here",
"tls": true,
"from_address": "[email protected]",
"from_name": "cliq",
"channels": {
"default": ["[email protected]"],
"stakeholders": ["[email protected]", "[email protected]"]
}
}
}
}

The default channel is used when a notify block doesn’t specify a channel name.


The email agent does not produce handoff envelopes. It is a fire-and-forget notification delivery mechanism with no downstream data.


Send an email to the default recipients when work finishes.

phases:
- name: implement
agent: cursor
notify:
on_complete:
agent: email
channel: default
subject: "Pipeline completed successfully"
- name: finalize
agent: git
action: create_pr
depends_on: [implement]

Alert the on-call team via email when a review gate times out or is rejected.

phases:
- name: implement
agent: cursor
- name: review
type: gate
agent: hug
depends_on: [implement]
review:
reviewer: tech-lead
timeout: 4h
notify:
on_escalate:
agent: email
channel: oncall
subject: "Review escalated — action required"

Example: Stakeholder reporting with multiple channels

Section titled “Example: Stakeholder reporting with multiple channels”

Notify different groups based on outcome — stakeholders for success, on-call for failures.

phases:
- name: deploy
agent: exec
depends_on: [review]
commands:
- name: deploy-prod
run: ./scripts/deploy.sh production
escalate_on_fail: true
notify:
on_complete:
agent: email
channel: stakeholders
subject: "Release deployed to production"
on_fail:
agent: email
channel: oncall
subject: "URGENT: Production deployment failed"

  1. Obtain SMTP credentials from your email provider (Gmail, SendGrid, AWS SES, etc.)
  2. Configure the connection settings:
Terminal window
cliq settings agents.email.smtp_host smtp.example.com --global
cliq settings agents.email.smtp_port 587 --global
cliq settings agents.email.username "[email protected]" --global
echo $SMTP_PASS | cliq settings agents.email.password --stdin --global
cliq settings agents.email.from_address "[email protected]" --global
cliq settings agents.email.from_name "cliq" --global
  1. Add recipient channels:
Terminal window
cliq settings --json agents.email.channels.default '["[email protected]"]' --global
cliq settings --json agents.email.channels.oncall '["[email protected]", "[email protected]"]' --global
  1. Validate:
Terminal window
cliq doctor agent email

cliq doctor agent email checks:

  • SMTP configuration (smtp_host, channels) is set
  • At least one channel (preferably default) has valid recipients
  • SMTP connection can be established