email-notify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEmail Notify
邮件通知
Overview
概述
Send an email notification after each Codex task. Use the helper script to resolve the project name and send via SMTP.
在每个Codex任务完成后发送邮件通知。使用辅助脚本解析项目名称并通过SMTP发送邮件。
User Preparation
用户准备
1) Configure environment variables
1) 配置环境变量
Add the following lines to (Linux) or (macOS):
~/.bashrc~/.zshrcexport CODEX_MACHINE_NAME="Machine-name" # e.g., Macbook
export CODEX_EMAIL_SMTP_HOST="smtp.example.com"
export CODEX_EMAIL_SMTP_PORT="587"
export CODEX_EMAIL_USERNAME="user@example.com"
export CODEX_EMAIL_PASSWORD="..."
export CODEX_EMAIL_FROM="user@example.com"
export CODEX_EMAIL_TO="recipient1@example.com,recipient2@example.com"
export CODEX_EMAIL_USE_TLS="false" # true/false, default false
export CODEX_EMAIL_USE_SSL="true" # true/false, default trueIf your SMTP server does not require auth, leave and unset.
Set to for SMTPS (typically port 465) and to for STARTTLS.
Do not set both and to .
CODEX_EMAIL_USERNAMECODEX_EMAIL_PASSWORDCODEX_EMAIL_USE_SSLtrueCODEX_EMAIL_USE_TLStrueCODEX_EMAIL_USE_TLSCODEX_EMAIL_USE_SSLtrue将以下行添加到(Linux)或(macOS)中:
~/.bashrc~/.zshrcexport CODEX_MACHINE_NAME="Machine-name" # 例如:Macbook
export CODEX_EMAIL_SMTP_HOST="smtp.example.com"
export CODEX_EMAIL_SMTP_PORT="587"
export CODEX_EMAIL_USERNAME="user@example.com"
export CODEX_EMAIL_PASSWORD="..."
export CODEX_EMAIL_FROM="user@example.com"
export CODEX_EMAIL_TO="recipient1@example.com,recipient2@example.com"
export CODEX_EMAIL_USE_TLS="false" # true/false,默认值为false
export CODEX_EMAIL_USE_SSL="true" # true/false,默认值为true如果你的SMTP服务器不需要认证,请留空和。
对于SMTPS(通常端口为465),请将设置为;对于STARTTLS,请将设置为。
请勿同时将和设置为。
CODEX_EMAIL_USERNAMECODEX_EMAIL_PASSWORDCODEX_EMAIL_USE_SSLtrueCODEX_EMAIL_USE_TLStrueCODEX_EMAIL_USE_TLSCODEX_EMAIL_USE_SSLtrue2) Add instruction in project AGENTS.md
2) 在项目的AGENTS.md中添加指令
For example, add this instruction to AGENTS.md:
Use skill email-notify to notify users when each agent run is finished or when any notifications would be sent to users.
例如,将以下指令添加到AGENTS.md中:
当每个agent运行结束或需要向用户发送任何通知时,使用skill email-notify来通知用户。
Workflow
工作流程
1) Provide a project name source (optional)
1) 提供项目名称来源(可选)
- To override the folder name, define a project name in using one of:
AGENTS.md- YAML frontmatter: (or
project_name: My Project)name: - A plain line:
Project Name: My Project
- YAML frontmatter:
- If no name is found, the script uses the project folder name.
- 若要覆盖文件夹名称,可在中通过以下方式定义项目名称:
AGENTS.md- YAML前置元数据:(或
project_name: My Project)name: - 普通行:
Project Name: My Project
- YAML前置元数据:
- 如果未找到名称,脚本将使用项目文件夹名称。
2) Send the notification at task completion
2) 在任务完成时发送通知
- Generate a short task title (3-8 words).
- Pick an execution status: ,
success,failed,partial, etc.blocked - Write a brief result summary; avoid secrets.
Run:
bash
python3 ~/.codex/skills/email-notify/scripts/send_email_notification.py \
--task-title "..." \
--status "success" \
--summary "..." \
--project-name "..."- 生成简短的任务标题(3-8个单词)。
- 选择执行状态:、
success、failed、partial等。blocked - 编写简短的结果摘要;避免包含敏感信息。
运行以下命令:
bash
python3 ~/.codex/skills/email-notify/scripts/send_email_notification.py \
--task-title "..." \
--status "success" \
--summary "..." \
--project-name "..."Resources
资源
- : Send the email notification and resolve the project name.
scripts/send_email_notification.py
- : 发送邮件通知并解析项目名称。
scripts/send_email_notification.py