Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

resend-inbound-emails重新发送入站电子邮件

Agent Skill

resend-inbound-emails 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,117

周安装

48

GitHub Stars

公开资料未说明

下载量

392
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:resend-inbound-emails(重新发送入站电子邮件)
来源仓库:https://github.com/blink-new/claude
仓库路径:skills/resend-inbound-emails
安装命令:
npx skills add https://github.com/blink-new/claude --skill resend-inbound-emails
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/blink-new/claude --skill resend-inbound-emails

简介

用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限与联网能力。
  • 建议结合原始 README 核验具体用法,注意维护状态和功能边界。
  • 使用前请检查是否会触发文件读写或命令执行,确保环境安全。

SKILL.md

When to Use This Skill

Use when:

  • Setting up two-way email communication (send and receive)
  • Implementing custom sending domain management
  • Building an inbox system with threading
  • Adding AI-powered email personalization
  • Processing inbound emails via webhooks

Features Overview

Core Features (Required)

FeatureDescription
Custom DomainsAdd, verify, and manage sending domains via Resend API
Inbound WebhooksReceive and process incoming emails with threading
Single SendSend emails individually with RFC 5322 threading
User SettingsNotification preferences, sending domain selection
Real-time UpdatesPolling for instant inbox updates with toast notifications
NotificationsEmail notifications to team members on replies

Optional Features

FeatureDescription
AI PersonalizationAI-powered {{tag}} replacement using Vercel AI SDK
Preview/ReviewReview and edit personalized emails before sending
Bulk SendSend emails in batches via pg-boss queue
Rich Text EditorTipTap-based editor with attachments and formatting

Architecture Diagram

┌─────────────────────────────────────────────────────────────────────┐
│                         OUTBOUND FLOW                               │
├─────────────────────────────────────────────────────────────────────┤
│  Composer → Detect {{tags}} → Generate Previews → Review Modal      │
│                                      ↓                              │
│  Send via Resend → Store InboxMessage → Update Thread               │
├─────────────────────────────────────────────────────────────────────┤
│                         INBOUND FLOW                                │
├─────────────────────────────────────────────────────────────────────┤
│  Resend Webhook → Verify Signature → Parse Headers                  │
│         ↓                                                           │
│  Match Thread (RFC 5322) → Resolve Creator → Store Message          │
│         ↓                                                           │
│  Notify Team → Publish Event → Update UI via Polling/SSE            │
└─────────────────────────────────────────────────────────────────────┘

Prerequisites

  • Resend account with API key
  • PostgreSQL database
  • pg-boss for bulk email queue
  • Vercel AI SDK for personalization

Environment Variables

# Resend
RESEND_API_KEY="re_your_api_key"
RESEND_WEBHOOK_SECRET="whsec_your_webhook_secret"
EMAIL_FROM="onboarding@resend.dev"

# Your default inbound domain (set up in Resend dashboard)
# Format: emails to *@yourdomain.com will be forwarded to your webhook
DEFAULT_EMAIL_DOMAIN="inbox.yourdomain.com"

# App URL for notification links
NEXT_PUBLIC_APP_URL="https://yourdomain.com"

Database Schema

Add these models to your Prisma schema:

Team Domain Management

model TeamDomain {
  id     String @id @default(cuid())
  teamId String
  team   Team   @relation(fields: [teamId], references: [id], onDelete: Cascade)

  resendDomainId String  @unique // Resend's domain ID
  domain         String // e.g., "acme.com"
  status         String  @default("not_started") // "not_started" | "pending" | "verified" | "invalid"
  isActive       Boolean @default(false) // Only one domain can be active per team

  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  @@unique([teamId, domain])
  @@index([teamId])
}

Inbox Threading

model InboxThread {
  id            String   @id @default(cuid())
  teamId        String
  creatorId     String?  // Link to your entity (creator, contact, etc.)
  creatorEmail  String   // Primary email for this thread
  primaryEmail  String?  // Original email the thread was created with
  isRead        Boolean  @default(false)
  isArchived    Boolean  @default(false)
  lastMessageAt DateTime
  createdAt     DateTime @default(now())
  updatedAt     DateTime @updatedAt

  // Track all emails that have participated
  participantEmails String[] @default([])

  team     Team           @relation(fields: [teamId], references: [id], onDelete: Cascade)
  messages InboxMessage[]

  @@index([teamId, lastMessageAt])
  @@index([teamId, creatorId])
}

model InboxMessage {
  id             String              @id @default(cuid())
  threadId       String
  direction      InboxDirection      // INBOUND or OUTBOUND
  from           String
  to             String
  subject        String?
  textBody       String?
  htmlBody       String?
  resendEmailId  String?
  messageId      String?             // RFC 5322 Message-ID
  inReplyTo      String?             // RFC 5322 In-Reply-To
  references     String[]            // RFC 5322 References chain
  sentAt         DateTime?
  receivedAt     DateTime?
  deliveryStatus InboxDeliveryStatus @default(PENDING)
  createdAt      DateTime            @default(now())
  updatedAt      DateTime            @updatedAt

  thread      InboxThread       @relation(fields: [threadId], references: [id], onDelete: Cascade)
  attachments InboxAttachment[]

  @@index([resendEmailId])
  @@index([messageId])
}

model InboxAttachment {
  id        String @id @default(cuid())
  messageId String
  filename  String
  url       String
  size      Int?
  contentType String?

  message InboxMessage @relation(fields: [messageId], references: [id], onDelete: Cascade)
}

enum InboxDirection {
  INBOUND
  OUTBOUND
}

enum InboxDeliveryStatus {
  PENDING
  SENT
  DELIVERED
  BOUNCED
  FAILED
}

Personalization Review

model PersonalizedEmailPreview {
  id              String             @id @default(cuid())
  teamId          String
  creatorId       String?
  createdById     String

  originalSubject String
  originalBody    String             @db.Text
  personalizedSubject String
  personalizedBody    String         @db.Text
  explanation         String?        @db.Text

  recipientEmail  String
  recipientName   String?
  status          EmailReviewStatus  @default(PENDING)

  editedSubject   String?
  editedBody      String?            @db.Text
  wasEdited       Boolean            @default(false)
  sentMessageId   String?            @unique

  createdAt       DateTime           @default(now())
  updatedAt       DateTime           @updatedAt
  expiresAt       DateTime           // 7 days from creation

  @@index([teamId, status])
}

enum EmailReviewStatus {
  PENDING
  SENT
  EXPIRED
}

Core Patterns

1. Custom Domain Management

Users can add custom sending domains through Resend API:

// Add domain
const { data } = await resend.domains.create({ name: "acme.com" });

// Verify DNS records
await resend.domains.verify(domainId);

// Get DNS records for user to configure
const { data: details } = await resend.domains.get(domainId);
// details.records contains MX, TXT, DKIM records

2. Building From/Reply-To Addresses

// Always use your inbound domain for reply-to to ensure tracking
const fromAddress = buildFromAddress(userEmail, userName, sendingDomain);
// Result: "Kai <kai@acme.com>"

const replyTo = buildReplyToAddress(userEmail);
// Result: "kai@inbox.yourdomain.com" (your inbound domain)

3. RFC 5322 Email Threading

Thread continuity is maintained using standard email headers:

// On send: build headers from previous messages
const lastMessage = await getLastThreadMessage(threadId);
const headers = {
  "Message-ID": `<${uuid()}@${EMAIL_DOMAIN}>`,
  "In-Reply-To": formatMessageIdHeader(lastMessage?.messageId),
  "References": buildReferencesHeader(
    mergeReferences(lastMessage?.references ?? [], lastMessage?.messageId)
  ),
};

// On receive: match thread by headers
const match = await findThreadByHeaders({
  teamId,
  messageId: parseMessageIdHeader(headers["message-id"]),
  inReplyTo: parseMessageIdHeader(headers["in-reply-to"]),
  references: parseReferencesHeader(headers["references"]),
});

4. Resend Webhook Processing

// Verify webhook signature using Svix headers
const payload = await req.text(); // Must read as text, not json
const event = resend.webhooks.verify({
  payload,
  headers: {
    id: req.headers.get("svix-id") ?? "",
    timestamp: req.headers.get("svix-timestamp") ?? "",
    signature: req.headers.get("svix-signature") ?? "",
  },
  webhookSecret: process.env.RESEND_WEBHOOK_SECRET ?? "",
});

// Handle event types
switch (event.type) {
  case "email.received":
    // Fetch full email content
    const { data: email } = await resend.emails.receiving.get(event.data.email_id);
    // email.html, email.text, email.headers, email.attachments
    break;
  case "email.delivered":
  case "email.bounced":
    // Update delivery status
    break;
}

Important:

  • Read payload as req.text(), not req.json() before verification
  • Svix headers use lowercase with hyphens: svix-id, svix-timestamp, svix-signature
  • Always deduplicate using resendEmailId before processing

5. AI Personalization with {{Tags}} (OPTIONAL)

Note: This feature is optional. Skip if you don't need AI-powered email personalization.
// Detect if personalization is needed
if (hasLiquidTags(subject) || hasLiquidTags(body)) {
  const result = await generatePersonalizedEmail({
    subject,
    body,
    context: buildPersonalizationContext({ creator, team, sender }),
  });

  // Verify all tags were replaced
  if (hasLiquidTags(result.subject) || hasLiquidTags(result.message)) {
    throw new Error("Personalization failed");
  }
}

Available tags:

  • {{name}} - Creator's name
  • {{time_based_greeting}} - Day-appropriate greeting
  • {{compliment}} - AI-generated compliment
  • {{content_fit_pitch}} - Why collaboration makes sense
  • {{reply_cta}} - Call to action
  • {{user_name}} - Sender's name

Required for personalization:

  • Vercel AI SDK (@ai-sdk/gateway)
  • Team personalization settings UI
  • PersonalizedEmailPreview model (for review workflow)

6. Bulk Email with pg-boss (OPTIONAL)

Note: This feature is optional. Skip if you only need single email sending.
// Queue bulk send job
await boss.send(QUEUES.BULK_SEND_EMAIL, {
  teamId,
  recipients: [{ creatorId, email, name }],
  subject,
  body,
  fromEmail: session.user.email,
}, DEFAULT_JOB_OPTIONS);

// Worker processes in batches of 100 via Resend batch API
const { data } = await resend.batch.send(emailObjects);

Required for bulk send:

  • pg-boss setup (see team-saas skill)
  • Bulk send API route
  • Worker handler for BULK_SEND_EMAIL jobs

File Structure

src/
├── app/api/
│   ├── teams/[teamId]/
│   │   ├── domains/
│   │   │   ├── route.ts              # List/add domains
│   │   │   └── [domainId]/
│   │   │       ├── route.ts          # Get/delete domain
│   │   │       ├── verify/route.ts   # Verify DNS
│   │   │       └── activate/route.ts # Activate domain
│   │   ├── inbox/
│   │   │   ├── send/route.ts         # Single email send
│   │   │   ├── bulk-send/route.ts    # Bulk send (queued)
│   │   │   ├── threads/route.ts      # List threads
│   │   │   ├── personalization/
│   │   │   │   └── preview/route.ts  # Generate previews
│   │   │   └── reviews/              # Review management
│   │   └── ...
│   └── webhooks/
│       └── resend/route.ts           # Webhook handler
├── lib/
│   ├── resend.ts                     # Client + address builders
│   ├── inbox/
│   │   ├── threading.ts              # Thread matching
│   │   ├── email-headers.ts          # RFC 5322 utilities
│   │   ├── reply-parser.ts           # Strip quoted content
│   │   ├── resend-webhook.ts         # Webhook helpers
│   │   └── inbound-notification.ts   # Team notifications
│   ├── personalization/
│   │   ├── types.ts                  # Context types
│   │   ├── build-context.ts          # Build AI context
│   │   ├── generate-personalized-email.ts
│   │   └── process-liquid-tags.ts    # Tag detection
│   └── jobs/handlers/
│       └── bulk-email-handler.ts     # Bulk send worker
├── hooks/
│   ├── use-inbox.ts                  # Thread/message hooks
│   ├── use-inbox-polling.ts          # Real-time updates
│   ├── use-team-domains.ts           # Domain management
│   └── use-email-reviews.ts          # Review hooks
└── components/
    ├── inbox/
    │   ├── inbox-editor.tsx          # TipTap rich editor
    │   ├── inbox-compose-dialog.tsx  # Compose modal
    │   ├── inbox-message-bubble.tsx  # Message display
    │   ├── personalization-button.tsx# Tag insertion
    │   └── personalization-preview-modal.tsx
    └── settings/
        ├── team-domains-section.tsx  # Domain UI
        └── domain-dns-records.tsx    # DNS records table

Asset Files Included

AssetDescription
assets/lib/resend.tsResend client + address builders
assets/lib/inbox/threading.tsThread matching logic
assets/lib/inbox/email-headers.tsRFC 5322 utilities
assets/lib/inbox/reply-parser.tsStrip quoted content
assets/lib/inbox/inbound-notification.tsNotification emails
assets/lib/personalization/types.tsContext types (OPTIONAL)
assets/lib/personalization/process-liquid-tags.tsTag detection (OPTIONAL)
assets/api/domains-route.tsDomain management API
assets/api/inbox-send-route.tsSingle send API
assets/api/webhook-resend-route.tsWebhook handler
assets/hooks/use-team-domains.tsDomain hooks
assets/hooks/use-inbox.tsInbox hooks
assets/prisma/schema-additions.prismaSchema models
assets/api/users-me-route.tsUser profile GET/PATCH
assets/api/available-domains-route.tsGet user's available domains
assets/api/inbox-updates-route.tsPolling endpoint for new messages
assets/hooks/use-user.tsUser profile hooks
assets/hooks/use-available-domains.tsAvailable domains hook
assets/hooks/use-inbox-polling.tsInbox polling with toasts
assets/components/notifications-section.tsxNotification toggle UI
assets/components/email-settings-section.tsxDomain selector UI
assets/components/team-personalization-section.tsxAI personalization settings (OPTIONAL)
assets/components/inbox-notification-provider.tsxPolling provider wrapper
assets/lib/redis.tsRedis pub/sub client (OPTIONAL)
assets/api/inbox-events-sse-route.tsSSE endpoint (OPTIONAL)
assets/hooks/use-inbox-realtime.tsSSE hook (OPTIONAL)

Setup Instructions

1. Configure Resend

  1. Create account at resend.com
  2. Get API key from dashboard
  3. Set up inbound domain:

- Go to Resend Dashboard → Domains - Add your inbound domain (e.g., inbox.yourdomain.com) - Configure DNS MX record to point to Resend - Set up webhook endpoint

2. Configure Webhook

In Resend Dashboard → Webhooks:

  • URL: https://yourdomain.com/api/webhooks/resend
  • Events: email.received, email.delivered, email.bounced, email.sent
  • Copy the webhook secret to RESEND_WEBHOOK_SECRET

3. Install Dependencies

bun add resend
bun add @tiptap/react @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-placeholder

4. Add Database Models

Copy schema additions from assets/prisma/schema-additions.prisma to your schema.

5. Copy Asset Files

Copy template files from assets/ to your project structure.

Inbound Email Matching Priority

When an email is received:

  1. Deduplication - Check if resendEmailId already exists (skip if duplicate)
  2. OUTBOUND Detection - Check if sender is team member sending externally
  3. RFC 5322 Headers - Match via Message-ID, In-Reply-To, or References
  4. Creator Email - Match sender against primary creator email
  5. Creator Contacts - Match sender against associated contact emails
  6. Domain Match - Match sender domain against creator email domain
  7. Auto-create - Create new creator if no match found

OUTBOUND Detection: If a team member sends an email from their personal email client (Gmail, Outlook) to an external address, the webhook will receive it as email.received. The handler detects this by checking if the sender is a team member and creates an OUTBOUND message record.

User Domain Selection Flow

  1. Admin adds domain via Team Settings → Domains
  2. User configures DNS records (MX, SPF, DKIM)
  3. Admin verifies domain via "Verify DNS" button
  4. Admin activates domain (one active per team)
  5. User selects preferred domain in Personal Settings → Email
  6. Emails sent use user's selected domain for From address
  7. Reply-To always uses inbound domain for tracking

User Settings

Notification Preferences

Users can toggle email notifications for inbound replies:

// PATCH /api/users/me
{ notifyInboundEmail: true }

// Only members with notifyInboundEmail: true receive notifications
// If creator has an assignee, only the assignee is notified

Sending Domain Selection

Users can select their preferred sending domain from verified team domains:

// GET /api/users/me/available-domains
// Returns all verified domains from user's teams

// PATCH /api/users/me
{ sendFromDomain: "acme.com" }  // or null for default

// Validated: domain must be verified and belong to user's team

Team Settings

AI Personalization Configuration (OPTIONAL)

Note: Skip this section if you don't need AI personalization.

Teams can configure AI personalization settings:

FieldDescription
personalizationAboutUsTeam description for AI context (max 2000 chars)
personalizationModelIdAI model: google/gemini-3-flash, anthropic/claude-sonnet-4.5, etc.
personalizationInstructionsCustom AI instructions (max 2000 chars)
personalizationPreviewEnabledShow preview modal before sending personalized emails
// PATCH /api/teams/[teamId]
{
  personalizationAboutUs: "We are a marketing agency...",
  personalizationModelId: "google/gemini-3-flash",
  personalizationInstructions: "Keep tone professional but friendly",
  personalizationPreviewEnabled: true
}

Real-time Updates

Two approaches are available. Polling is recommended for simplicity and serverless compatibility.

Option 1: Polling (Recommended)

The system uses polling (10s interval) for reliability with serverless:

// Wrap dashboard with InboxNotificationProvider
<InboxNotificationProvider>
  <DashboardShell>{children}</DashboardShell>
</InboxNotificationProvider>

// Hook configuration
useInboxPolling(teamId, {
  interval: 10000,  // 10 seconds
  enabled: true,
});

Features:

  • Toast notifications for new messages (max 3, then summary)
  • Auto-refetch inbox queries on new messages
  • Memory cleanup (keeps last 100 message IDs)
  • Click "View" to navigate to message
  • No Redis required

Option 2: SSE with Redis (OPTIONAL)

For true real-time updates, use Server-Sent Events with Redis pub/sub:

// Hook usage
useInboxRealtime(teamId, {
  enabled: true,
  onNewMessage: (data) => console.log("New message:", data),
});

Requirements:

  • Redis instance (e.g., Railway Redis)
  • REDIS_URL environment variable
  • ioredis package

Flow:

  1. Webhook receives email → calls publishInboxEvent(teamId, event)
  2. Redis publishes to channel inbox:events:{teamId}
  3. SSE connections subscribed to channel receive event instantly
  4. Frontend updates via useInboxRealtime hook

Event types:

  • new_message - New inbound email received
  • inbox_update - Thread/message updated
  • message_status - Delivery status changed (sent, delivered, bounced)

Advantages: True real-time, more efficient Disadvantages: Requires Redis, connection limits with serverless

Checklist

Core Setup (Required)

  • Resend API key configured
  • Inbound domain set up in Resend
  • Webhook endpoint deployed and verified
  • Database schema updated (TeamDomain, InboxThread, InboxMessage)
  • Resend client utilities added
  • Threading utilities added
  • Webhook handler implemented
  • Domain management API routes
  • Single email send API route
  • User settings (notification toggle, domain selector)
  • Inbox polling with toast notifications

Optional Features

  • AI Personalization system (lib/personalization/*, team settings UI)
  • PersonalizedEmailPreview model + review API routes
  • pg-boss worker for bulk send
  • TipTap rich text editor
  • SSE with Redis for true real-time (lib/redis.ts, inbox/events route)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.69%
按下载量换算136

Claude

28.49%
按下载量换算112

Cursor

20.92%
按下载量换算82

Gemini CLI

10.48%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills