Gog email send

From evolution-foundation/evo-nexus · View interactive version

Gog email send is an AI agent skill from the GitHub repository evolution-foundation/evo-nexus. Send email messages with explicit user confirmation. Requires the exact confirmation string "YES, SEND" before executing send operations. Logs all sends to audit trail. Use ONLY when user explicitly confirms they want to send an email, never auto-invoke. This is a critical write operation requiring

How to use this skill

Skill file

Email Sending with Confirmation

⚠️ CRITICAL: This skill sends emails. It MUST NOT be invoked without explicit user confirmation.

Send emails only after receiving the exact confirmation string: "YES, SEND"

When to Use

Use this skill ONLY when:

NEVER use this skill:

Confirmation Requirements

The ONLY Acceptable Confirmation

User MUST type exactly: "YES, SEND"

Acceptable variations (all must include "YES, SEND"):

NOT acceptable:

Workflow

Step 1: Verify Confirmation String

Before ANY sending operation, check:

Does the user's message contain the EXACT string "YES, SEND"?
  - YES → Proceed to Step 2
  - NO → STOP and request confirmation

If confirmation is missing, respond:

⚠️  **Confirmation Required**

To send this email, please confirm by typing exactly:

**YES, SEND**

I need this explicit confirmation to ensure you've reviewed the email and want it sent.

**Reminder**: This will send email to:
- [List recipients]
- Subject: [Subject line]

STOP HERE. Do not proceed until confirmation is received.

Step 2: Display Final Summary

Show the user exactly what will be sent:

📧 **Ready to Send**

**From**: [Your email address, if known]
**To**: [recipient1@example.com, recipient2@example.com]
**CC**: [cc recipients, if any]
**Subject**: [Subject line]

**Body**:

[First 200 characters of body...]

[Body continues for N more characters...]


**Attachments**: [List attachments if any, or "None"]

---

Is this correct? If yes, I'll send it now.

Step 3: Execute Send

Determine send method:

Option A: Send existing draft

If user has a draft_id:

gog gmail drafts send <draft_id> --json

Option B: Direct send

If composing directly (less common):

# Save body to temp file
cat > /tmp/email_body_$$.txt << 'EOF'
Email body content
EOF

gog gmail send \
  --to "recipient1@example.com,recipient2@example.com" \
  --cc "cc@example.com" \
  --subject "Subject line" \
  --body /tmp/email_body_$$.txt \
  --json

# Clean up temp file
rm /tmp/email_body_$$.txt

Step 4: Log to Audit Trail

Immediately after sending (success or failure), log the action:

# Source logging utility
source "$(dirname "$0")/../../_shared/scripts/log.sh"

# Log successful send
log_action "gog-email-send" "email-send" "success" "$MESSAGE_ID" \
  "{\"to\":[\"recipient@example.com\"],\"subject\":\"$SUBJECT\",\"confirmation\":\"YES, SEND\"}"

# OR log failed send
log_action "gog-email-send" "email-send" "failure" "" \
  "{\"to\":[\"recipient@example.com\"],\"subject\":\"$SUBJECT\",\"error\":\"$ERROR_MSG\"}"

Audit log entry should include:

Step 5: Confirm Completion

If successful:

✅ **Email Sent Successfully**

Message ID: msg_abc123
Sent at: [timestamp]
Recipients: [list]

The email has been sent and logged to your audit trail.

Next steps:
- Track response with follow-up? (gog-followups skill)
- Send another email?

If failed:

❌ **Send Failed**

Error: [Error message from GOG]

The email was NOT sent. Common issues:
- Authentication expired (run: gog auth login)
- Invalid recipient email address
- Network connectivity issues
- Insufficient permissions

Would you like to:
- Retry sending?
- Save as draft for later?
- Edit the email?

Output Format (Strict)

Before Sending (Awaiting Confirmation)

⚠️  **Confirmation Required**

To send this email, please type: **YES, SEND**

**Email Summary**:
- To: [recipients]
- Subject: [subject]
- Body: [snippet...]

I'm waiting for your explicit confirmation before sending.

After Sending (Success)

✅ **Email Sent**

Message ID: [msg_id]
Recipients: [list]
Timestamp: [ISO8601]

Logged to: ~/.gog-assistant/audit.log

After Sending (Failure)

❌ **Send Failed**

Error: [error message]

The email was NOT sent. [Troubleshooting guidance]

Examples

Example 1: Send Draft (Correct Flow)

User: "I've reviewed the draft. YES, SEND"

Assistant:

[Confirmation string detected: "YES, SEND" ✓]

📧 **Ready to Send**

**To**: client@acme.com
**Subject**: Re: Q2 Proposal

**Body**:

Hi Sarah,

Thank you for your patience. I've reviewed the Q2 proposal and have a few questions...

[287 more characters]

Sending now...

[Executes: gog gmail drafts send draft_abc123 --json]

[Logs to audit trail]

✅ Email Sent Successfully

Message ID: msg_xyz789

Sent at: 2026-01-28T15:30:00Z

Recipients: client@acme.com

The email has been sent and logged to your audit trail.

Would you like to set up a follow-up reminder for this email?


### Example 2: User Doesn't Confirm (Correct Block)

**User**: "Looks good, please send it"

**Assistant**:

⚠️ Confirmation Required

To send this email, please confirm by typing exactly:

YES, SEND

I need this explicit confirmation to ensure you've reviewed the email and want it sent.

Reminder: This will send email to:


[STOPS HERE. Does not send.]

### Example 3: Send Fails

**User**: "YES, SEND"

**Assistant**:

[Confirmation string detected: "YES, SEND" ✓]

📧 Ready to Send

[Displays summary...]

Sending now...

[Executes: gog gmail drafts send draft_abc123 --json]

❌ Send Failed

Error: Authentication token expired

The email was NOT sent.

Fix: Run gog auth login to re-authenticate, then try again.

Would you like me to save this draft so you can send it after re-authenticating?


### Example 4: Testing Confirmation Blocking

**User**: "Send the draft to the test address"

**Assistant**:

⚠️ Confirmation Required

To send this email, please confirm by typing exactly:

YES, SEND

I need this explicit confirmation before sending any email.

Email Summary:

Please review the email details above and confirm if you want to proceed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.