شعار Send Email

Send Email

المجتمع
MoizIbnYousaf
send-email

Use when sending transactional emails (welcome messages, order confirmations, password resets, receipts), notifications, or bulk emails via Resend API. Triggers on "send email", "transactional email", "welcome email", "Resend API", "password reset email", "order confirmation", "receipt email", "notification email", "bulk email send".

نظرة عامة

الناشرMoizIbnYousaf
المستودعmarketing-cli
اسم المهارةsend-email
النجوم
35
التفريعات
5
الملفات المرفقة
5
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 5

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها MoizIbnYousaf على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Send Email في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/MoizIbnYousaf/marketing-cli/tree/main/skills/send-email
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MoizIbnYousaf/marketing-cli.git /tmp/marketing-cli
mkdir -p .claude/skills
cp -r /tmp/marketing-cli/skills/send-email .claude/skills/send-email
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Send Email في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Send Email تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Send Email بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Send Email with Resend

This skill is primarily context-independent, but when brand/voice-profile.md exists, use it to inform email tone, vocabulary, and personality for any copy written within emails.

On Activation

  1. Detect project language from config files (package.json, requirements.txt, go.mod, etc.).
  2. Install Resend SDK if not present — see references/installation.md.
  3. Determine single vs batch send based on the user's needs (see decision matrix below).
  4. Implement with idempotency keys, error handling, and retry logic.

Output: Email sending code with production-grade error handling integrated into the user's project.

Overview

Resend provides two endpoints for sending emails:

ApproachEndpointUse Case
SinglePOST /emailsIndividual transactional emails, emails with attachments, scheduled sends
BatchPOST /emails/batchMultiple distinct emails in one request (max 100), bulk notifications

Choose batch when:

  • Sending 2+ distinct emails at once
  • Reducing API calls is important (by default, rate limit is 2 requests per second)
  • No attachments or scheduling needed

Choose single when:

  • Sending one email
  • Email needs attachments
  • Email needs to be scheduled
  • Different recipients need different timing

Quick Start

  1. Detect project language from config files (package.json, requirements.txt, go.mod, etc.)
  2. Install SDK (preferred) or use cURL - See references/installation.md
  3. Choose single or batch based on the decision matrix above
  4. Implement best practices - Idempotency keys, error handling, retries

Best Practices (Critical for Production)

Always implement these for production email sending. See references/best-practices.md for complete implementations.

Idempotency Keys

Prevent duplicate emails when retrying failed requests.

Key Facts
Format (single)<event-type>/<entity-id> (e.g., welcome-email/user-123)
Format (batch)batch-<event-type>/<batch-id> (e.g., batch-orders/batch-456)
Expiration24 hours
Max length256 characters
Duplicate payloadReturns original response without resending
Different payloadReturns 409 error

Error Handling

CodeAction
400, 422Fix request parameters, don't retry
401, 403Check API key / verify domain, don't retry
409Idempotency conflict - use new key or fix payload
429Rate limited - retry with exponential backoff (by default, rate limit is 2 requests/second)
500Server error - retry with exponential backoff

Retry Strategy

  • Backoff: Exponential (1s, 2s, 4s...)
  • Max retries: 3-5 for most use cases
  • Only retry: 429 (rate limit) and 500 (server error)
  • Always use: Idempotency keys when retrying

Single Email

Endpoint: POST /emails (prefer SDK over cURL)

Required Parameters

ParameterTypeDescription
fromstringSender address. Format: "Name <email@domain.com>"
tostring[]Recipient addresses (max 50)
subjectstringEmail subject line
html or textstringEmail body content

Optional Parameters

ParameterTypeDescription
ccstring[]CC recipients
bccstring[]BCC recipients
reply_to*string[]Reply-to addresses
scheduled_at*stringSchedule send time (ISO 8601)
attachmentsarrayFile attachments (max 40MB total)
tagsarrayKey/value pairs for tracking (see Tags)
headersobjectCustom headers

*Parameter naming varies by SDK (e.g., replyTo in Node.js, reply_to in Python).

Minimal Example (Node.js)

typescript
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

const { data, error } = await resend.emails.send(
  {
    from: 'Acme <onboarding@resend.dev>',
    to: ['delivered@resend.dev'],
    subject: 'Hello World',
    html: '<p>Email body here</p>',
  },
  { idempotencyKey: `welcome-email/${userId}` }
);

if (error) {
  console.error('Failed:', error.message);
  return;
}
console.log('Sent:', data.id);

See references/single-email-examples.md for all SDK implementations with error handling and retry logic.

Batch Email

Endpoint: POST /emails/batch (but prefer SDK over cURL)

Limitations

  • No attachments - Use single sends for emails with attachments
  • No scheduling - Use single sends for scheduled emails
  • Atomic - If one email fails validation, the entire batch fails
  • Max 100 emails per request
  • Max 50 recipients per individual email in the batch

Pre-validation

Since the entire batch fails on any validation error, validate all emails before sending:

  • Check required fields (from, to, subject, html/text)
  • Validate email formats
  • Ensure batch size <= 100

Minimal Example (Node.js)

typescript
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

const { data, error } = await resend.batch.send(
  [
    {
      from: 'Acme <notifications@acme.com>',
      to: ['delivered@resend.dev'],
      subject: 'Order Shipped',
      html: '<p>Your order has shipped!</p>',
    },
    {
      from: 'Acme <notifications@acme.com>',
      to: ['delivered@resend.dev'],
      subject: 'Order Confirmed',
      html: '<p>Your order is confirmed!</p>',
    },
  ],
  { idempotencyKey: `batch-orders/${batchId}` }
);

if (error) {
  console.error('Batch failed:', error.message);
  return;
}
console.log('Sent:', data.map(e => e.id));

See references/batch-email-examples.md for all SDK implementations with validation, error handling, and retry logic.

Large Batches (100+ Emails)

For sends larger than 100 emails, chunk into multiple batch requests:

  1. Split into chunks of 100 emails each
  2. Use unique idempotency keys per chunk: <batch-prefix>/chunk-<index>
  3. Send chunks in parallel for better throughput
  4. Track results per chunk to handle partial failures

See references/batch-email-examples.md for complete chunking implementations.

Deliverability

Follow these practices to maximize inbox placement.

For more help with deliverability, install the email-best-practices skill with npx skills add resend/email-best-practices.

Required

PracticeWhy
Valid SPF, DKIM, DMARC recordauthenticate the email and prevent spoofing
Links match sending domainIf sending from @acme.com, link to https://acme.com - mismatched domains trigger spam filters
Include plain text versionUse both html and text parameters for accessibility and deliverability (Resend generates a plain text version if not provided)
Avoid "no-reply" addressesUse real addresses (e.g., support@) - improves trust signals
Keep body under 102KBGmail clips larger messages

Recommended

PracticeWhy
Use subdomainsSend transactional from notifications.acme.com, marketing from mail.acme.com - protects reputation
Disable tracking for transactionalOpen/click tracking can trigger spam filters for password resets, receipts, etc.

Tracking (Opens & Clicks)

Tracking is configured at the domain level in the Resend dashboard, not per-email.

SettingHow it worksRecommendation
Open trackingInserts 1x1 transparent pixelDisable for transactional emails - can hurt deliverability
Click trackingRewrites links through redirectDisable for sensitive emails (password resets, security alerts)

When to enable tracking:

  • Marketing emails where engagement metrics matter
  • Newsletters and announcements

When to disable tracking:

  • Transactional emails (receipts, confirmations, password resets)
  • Security-sensitive emails
  • When maximizing deliverability is priority

Configure via dashboard: Domain → Configuration → Click/Open Tracking

Webhooks (Event Notifications)

Track email delivery status in real-time using webhooks. Resend sends HTTP POST requests to your endpoint when events occur.

EventWhen to use
email.deliveredConfirm successful delivery
email.bouncedRemove from mailing list, alert user
email.complainedUnsubscribe user (spam complaint)
email.opened / email.clickedTrack engagement (marketing only)

CRITICAL: Always verify webhook signatures. Without verification, attackers can send fake events to your endpoint.

See references/webhooks.md for setup, signature verification code, and all event types.

Tags

Tags are key/value pairs that help you track and filter emails.

typescript
tags: [
  { name: 'user_id', value: 'usr_123' },
  { name: 'email_type', value: 'welcome' },
  { name: 'plan', value: 'enterprise' }
]

Use cases:

  • Associate emails with customers in your system
  • Categorize by email type (welcome, receipt, password-reset)
  • Filter emails in the Resend dashboard
  • Correlate webhook events back to your application

Constraints: Tag names and values can only contain ASCII letters, numbers, underscores, or dashes. Max 256 characters each.

Templates

Use pre-built templates instead of sending HTML with each request.

typescript
const { data, error } = await resend.emails.send({
  from: 'Acme <hello@acme.com>',
  to: ['delivered@resend.dev'],
  subject: 'Welcome!',
  template: {
    id: 'tmpl_abc123',
    variables: {
      USER_NAME: 'John',      // Case-sensitive!
      ORDER_TOTAL: '$99.00'
    }
  }
});

IMPORTANT: Variable names are case-sensitive and must match exactly as defined in the template editor. USER_NAME ≠ user_name.

FactDetail
Max variables20 per template
Reserved namesFIRST_NAME, LAST_NAME, EMAIL, RESEND_UNSUBSCRIBE_URL, contact, this
Fallback valuesOptional - if not set and variable missing, send fails
Can't combine withhtml, text, or react parameters

Templates must be published in the dashboard before use. Draft templates won't work.

Testing

WARNING: Never test with fake addresses at real email providers.

Using addresses like test@gmail.com, example@outlook.com, or fake@yahoo.com will:

  • Bounce - These addresses don't exist
  • Destroy your sender reputation - High bounce rates trigger spam filters
  • Get your domain blocklisted - Providers flag domains with high bounce rates

Safe Testing Options

MethodAddressResult
Delivereddelivered@resend.devSimulates successful delivery
Bouncedbounced@resend.devSimulates hard bounce
Complainedcomplained@resend.devSimulates spam complaint
Your own emailYour actual addressReal delivery test

For development: Use the resend.dev test addresses to simulate different scenarios without affecting your reputation.

For staging: Send to real addresses you control (team members, test accounts you own).

Domain Warm-up

New domains must gradually increase sending volume to establish reputation.

Why it matters: Sudden high volume from a new domain triggers spam filters. ISPs expect gradual growth.

Recommended Schedule

Existing domain

DayMessages per dayMessages per hour
1Up to 1,000 emails100 Maximum
2Up to 2,500 emails300 Maximum
3Up to 5,000 emails600 Maximum
4Up to 5,000 emails800 Maximum
5Up to 7,500 emails1,000 Maximum
6Up to 7,500 emails1,500 Maximum
7Up to 10,000 emails2,000 Maximum

New domain

DayMessages per dayMessages per hour
1Up to 150 emails
2Up to 250 emails
3Up to 400 emails
4Up to 700 emails50 Maximum
5Up to 1,000 emails75 Maximum
6Up to 1,500 emails100 Maximum
7Up to 2,000 emails150 Maximum

Monitor These Metrics

MetricTargetAction if exceeded
Bounce rate< 4%Slow down, clean list
Spam complaint rate< 0.08%Slow down, review content

Don't use third-party warm-up services. Focus on sending relevant content to real, engaged recipients.

Suppression List

Resend automatically manages a suppression list of addresses that should not receive emails.

Addresses are added when:

  • Email hard bounces (address doesn't exist)
  • Recipient marks email as spam
  • You manually add them via dashboard

What happens: Resend won't attempt delivery to suppressed addresses. The email.suppressed webhook event fires instead.

Why this matters: Continuing to send to bounced/complained addresses destroys your reputation. The suppression list protects you automatically.

Management: View and manage suppressed addresses in the Resend dashboard under Suppressions.

Anti-Patterns

MistakeFix
Retrying without idempotency keyAlways include idempotency key - prevents duplicate sends on retry
Using batch for emails with attachmentsBatch doesn't support attachments - use single sends instead
Not validating batch before sendValidate all emails first - one invalid email fails the entire batch
Retrying 400/422 errorsThese are validation errors - fix the request, don't retry
Same idempotency key, different payloadReturns 409 error - use unique key per unique email content
Tracking enabled for transactional emailsDisable open/click tracking for password resets, receipts - hurts deliverability
Using "no-reply" sender addressUse real address like support@ - improves trust signals with email providers
Not verifying webhook signaturesAlways verify - attackers can send fake events to your endpoint
Testing with fake emails (test@gmail.com)Use delivered@resend.dev - fake addresses bounce and hurt reputation
Template variable name mismatchVariable names are case-sensitive - USER_NAME ≠ user_name
Sending high volume from new domainWarm up gradually - sudden spikes trigger spam filters

Notes

  • The from address must use a verified domain
  • If the sending address cannot receive replies, set the reply_to parameter to a valid address.
  • Store API key in RESEND_API_KEY environment variable
  • Node.js SDK supports react parameter for React Email components
  • Resend returns error, data, headers in the response.
  • Data returns { id: "email-id" } on success (single) or array of IDs (batch)
  • For marketing campaigns to large lists, use Resend Broadcasts instead

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Send Email؟

Use when sending transactional emails (welcome messages, order confirmations, password resets, receipts), notifications, or bulk emails via Resend API. Triggers on "send email", "transactional email", "welcome email", "Resend API", "password reset email", "order confirmation", "receipt email", "notification email", "bulk email send".

لماذا تستخدم Send Email على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Send Email عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Send Email في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/MoizIbnYousaf/marketing-cli/tree/main/skills/send-email. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Send Email؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Send Email؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Send Email معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Send Email مجانية؟

نعم. نشرها MoizIbnYousaf على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇