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:
- User has reviewed a draft and explicitly confirms they want to send it
- User provides the confirmation string "YES, SEND" in their message
- All draft content has been approved by the user
NEVER use this skill:
- Automatically after drafting an email
- Based on implied intent ("sounds good", "ok", "sure")
- Without showing the user exactly what will be sent
- Without receiving "YES, SEND" confirmation
Confirmation Requirements
The ONLY Acceptable Confirmation
User MUST type exactly: "YES, SEND"
Acceptable variations (all must include "YES, SEND"):
- "YES, SEND this email"
- "YES, SEND it"
- "YES, SEND the draft"
- "Confirmed. YES, SEND"
NOT acceptable:
- "Yes" / "OK" / "Sure" / "Go ahead" / "Send it"
- "Looks good, send it"
- "Please send"
- Any paraphrase that doesn't include the exact phrase "YES, SEND"
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:
- Timestamp (automatic)
- Skill name: "gog-email-send"
- Action: "email-send"
- Status: "success" or "failure"
- Entity ID: message_id (if successful)
- Details: to addresses, subject, confirmation string
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:
- client@acme.com
- Subject: Re: Q2 Proposal
[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:
- To: test@example.com
- Subject: [subject]
- Body: [snippet]
Please review the email details above and confirm if you want to proceed.