CtrlK
BlogDocsLog inGet started
Tessl Logo

email-automation

Automate email workflows, templates, and campaigns with Gmail MCP integration

Install with Tessl CLI

npx tessl i github:oyi77/1ai-skills --skill email-automation
What are skills?

Overall
score

18%

Does it follow best practices?

Validation for skill structure

Validation failed for this skill
This skill has errors that need to be fixed before it can move to Implementation and Activation review.
SKILL.md
Review
Evals

Email Automation

Automate email workflows, create templates, and manage campaigns using Gmail and MCP integrations.

Required Tools

MCP Servers

Gmail MCP Server

{
  "mcpServers": {
    "gmail-mcp": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-gmail"],
      "env": {
        "GOOGLE_CLIENT_ID": "${GOOGLE_CLIENT_ID}",
        "GOOGLE_CLIENT_SECRET": "${GOOGLE_CLIENT_SECRET}",
        "GOOGLE_REDIRECT_URI": "http://localhost:3000/oauth/callback"
      }
    }
  }
}

Nineteen Blocks (Sales Automation)

{
  "mcpServers": {
    "nineteen-blocks": {
      "command": "npx",
      "args": ["-y", "@nineteen-blocks/mcp-server"],
      "env": {
        "NINETEEN_BLOCKS_API_KEY": "${NINETEEN_BLOCKS_API_KEY}"
      }
    }
  }
}

Tool Permissions

ToolCapabilities
Bash(gmail:*)Execute Gmail CLI commands
MCP(gmail-mcp:*)Gmail API: send, read, label, draft
MCP(nineteen-blocks:*)Streak CRM, Sheets, Drive integration

Authentication

Setup Steps

  1. Create Google Cloud Project

    • Go to https://console.cloud.google.com
    • Create new project
    • Enable Gmail API
  2. Get OAuth Credentials

    • Go to "Credentials" → "Create Credentials" → "OAuth Client ID"
    • Desktop app (not web)
    • Download credentials.json
  3. Configure Environment

    export GOOGLE_CLIENT_ID="your-client-id"
    export GOOGLE_CLIENT_SECRET="your-client-secret"
    export NINETEEN_BLOCKS_API_KEY="your-api-key"
  4. First Run (OAuth)

    gmail auth
  5. Verify Connection

    gmail me

Pseudo Code

Example 1: Send Personalized Email

// 1. Load recipient data from sheet
const leads = await sheet.load("Q1_Prospects", "A:D");

// 2. For each lead, send personalized email
for (const lead of leads) {
  const email = {
    to: lead.email,
    subject: `Exclusive Offer for ${lead.company_name}`,
    body: `Hi ${lead.first_name}, ...`
  };
  
  await gmail.send(email);
  
  // Respect rate limits (100 emails/day)
  await delay(60000);
}

Example 2: Auto-Responder for Support

// Watch inbox for new emails
gmail.watch({
  labelIds: ["INBOX"],
  callback: async (email) => {
    if (email.subject.toLowerCase().includes("urgent")) {
      await gmail.send({
        to: email.from,
        subject: `Re: ${email.subject}`,
        body: "Thank you for reaching out..."
      });
    }
  }
});

Example 3: Email Campaign with Tracking

const recipients = await sheet.load("Campaign_Q1", "A:C");
const results = [];

for (const recipient of recipients) {
  const result = await gmail.send({
    to: recipient.email,
    subject: `Hi ${recipient.name}`,
    body: "..."
  });
  results.push({ email: recipient.email, status: result.success });
  await delay(1000);
}

CLI Reference

CommandDescription
gmail authStart OAuth authentication
gmail send --to user@email.com --subject "Subject" --body "Body"Send email
gmail list --label INBOX --max 10List recent emails
gmail read <message-id>Read specific email
gmail draft --to user@email.com --subject "Subject"Create draft
gmail label create "Label Name"Create new label

Error Handling

Error CodeMeaningRecovery
AUTH_001Invalid credentialsRun gmail auth
AUTH_002Token expiredRe-authenticate
RATE_001Daily limit (100/day)Wait 24 hours
SEND_001Invalid recipientCheck email format

Common Patterns

Batch Send with Rate Limiting

async function sendBatch(emails: Email[], delayMs = 60000) {
  const results = [];
  for (const email of emails) {
    try {
      const result = await gmail.send(email);
      results.push({ ...email, success: true, id: result.messageId });
    } catch (error) {
      results.push({ ...email, success: false, error: error.message });
    }
    await delay(delayMs);
  }
  return results;
}

Best Practices

  1. Rate Limits: Free Gmail = 100/day
  2. Warm Up: Start with 10-20 emails/day
  3. Personalization: Replace {{PLACEHOLDERS}}
  4. Unsubscribe: Always include link
  5. Compliance: Follow CAN-SPAM

Testing

# Dry run
gmail send --to test@example.com --subject "Test" --body "Test" --dry-run

Related Skills

  • productivity/google-workspace - Google Drive, Sheets integration
  • sales/sales-strategy - Sales email sequences

Skill v2.0 - Email Automation with MCP

Repository
github.com/oyi77/1ai-skills
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.