$npx -y skills add caopulan/Notification-Skill --skill email-notifySend SMTP email notifications after Codex completes a task. Use when one Codex or Claude run is finished, or when you need to notify on task completion with device name, project name, status, and summary via email.
| 1 | # Email Notify |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Send an email notification after each Codex task. Use the helper script to resolve the project name and send via SMTP. |
| 6 | |
| 7 | ## User Preparation |
| 8 | |
| 9 | ### 1) Configure environment variables |
| 10 | |
| 11 | Add the following lines to `~/.bashrc` (Linux) or `~/.zshrc` (macOS): |
| 12 | |
| 13 | ``` |
| 14 | export CODEX_MACHINE_NAME="Machine-name" # e.g., Macbook |
| 15 | export CODEX_EMAIL_SMTP_HOST="smtp.example.com" |
| 16 | export CODEX_EMAIL_SMTP_PORT="587" |
| 17 | export CODEX_EMAIL_USERNAME="user@example.com" |
| 18 | export CODEX_EMAIL_PASSWORD="..." |
| 19 | export CODEX_EMAIL_FROM="user@example.com" |
| 20 | export CODEX_EMAIL_TO="recipient1@example.com,recipient2@example.com" |
| 21 | export CODEX_EMAIL_USE_TLS="false" # true/false, default false |
| 22 | export CODEX_EMAIL_USE_SSL="true" # true/false, default true |
| 23 | ``` |
| 24 | |
| 25 | If your SMTP server does not require auth, leave `CODEX_EMAIL_USERNAME` and `CODEX_EMAIL_PASSWORD` unset. |
| 26 | Set `CODEX_EMAIL_USE_SSL` to `true` for SMTPS (typically port 465) and `CODEX_EMAIL_USE_TLS` to `true` for STARTTLS. |
| 27 | Do not set both `CODEX_EMAIL_USE_TLS` and `CODEX_EMAIL_USE_SSL` to `true`. |
| 28 | |
| 29 | ### 2) Add instruction in project AGENTS.md |
| 30 | |
| 31 | For example, add this instruction to AGENTS.md: |
| 32 | > Use skill email-notify to notify users when each agent run is finished or when any notifications would be sent to users. |
| 33 | |
| 34 | ## Workflow |
| 35 | |
| 36 | ### 1) Provide a project name source (optional) |
| 37 | |
| 38 | - To override the folder name, define a project name in `AGENTS.md` using one of: |
| 39 | - YAML frontmatter: `project_name: My Project` (or `name:`) |
| 40 | - A plain line: `Project Name: My Project` |
| 41 | - If no name is found, the script uses the project folder name. |
| 42 | |
| 43 | ### 2) Send the notification at task completion |
| 44 | |
| 45 | - Generate a short task title (3-8 words). |
| 46 | - Pick an execution status: `success`, `failed`, `partial`, `blocked`, etc. |
| 47 | - Write a brief result summary; avoid secrets. |
| 48 | |
| 49 | Run: |
| 50 | |
| 51 | ```bash |
| 52 | python3 ~/.codex/skills/email-notify/scripts/send_email_notification.py \ |
| 53 | --task-title "..." \ |
| 54 | --status "success" \ |
| 55 | --summary "..." \ |
| 56 | --project-name "..." |
| 57 | ``` |
| 58 | |
| 59 | ## Resources |
| 60 | |
| 61 | - `scripts/send_email_notification.py`: Send the email notification and resolve the project name. |