Skip to main content

Resend Integration

Send transactional emails, campaign broadcasts, and notification messages through Resend's email delivery infrastructure.

Overview

PROIGN uses Resend for all outbound email delivery across modules:

  • Campaign Module — Bulk email broadcasts, drip sequences, and newsletter delivery
  • Support Module — Ticket confirmation emails, status updates, and agent notifications
  • Fulfillment Module — Shipping confirmation and tracking number emails
  • Platform — Account verification, password reset, and invitation emails

Prerequisites

  • Resend account with API key
  • Verified sending domain in Resend dashboard
  • PROIGN tenant with at least one email-capable module enabled
  • Admin or owner role in PROIGN

Setup

1. Verify Your Domain

  1. Log in to Resend and go to Domains
  2. Add your sending domain (e.g., notifications.yourdomain.com)
  3. Add the DNS records (SPF, DKIM, DMARC) to your DNS provider
  4. Wait for verification (usually under 5 minutes)

2. Generate API Key

  1. Go to Resend → API Keys
  2. Create a new key with Sending access permission
  3. Restrict to your verified domain for security
  4. Copy the key — it is shown only once

3. Configure in PROIGN

The Resend API key is configured as a Cloudflare Worker secret at the platform level. Each module references it via service bindings — no per-tenant configuration is needed.

Email Types

TypeModuleTrigger
Campaign broadcastCampaignScheduled or manual send
Ticket confirmationSupportNew ticket created
Shipping notificationFulfillmentOrder shipped with tracking
Password resetPlatformUser requests reset
InvitationPlatformAdmin invites new user

Sending Emails

All email sending goes through the email-worker queue consumer. Modules dispatch email jobs to the queue, and the worker sends them through Resend:

// Email job dispatched to Cloudflare Queue
{
  "type": "send_email",
  "payload": {
    "to": "customer@example.com",
    "from": "support@notifications.proign.com",
    "subject": "Your ticket #1042 has been updated",
    "html": "<h1>Ticket Updated</h1><p>Status changed to In Progress...</p>",
    "replyTo": "support@tenant.com",
    "tags": [
      { "name": "module", "value": "support" },
      { "name": "tenant", "value": "acme-corp" }
    ]
  }
}

// Resend API response
{
  "id": "re_abc123",
  "from": "support@notifications.proign.com",
  "to": ["customer@example.com"],
  "created_at": "2026-02-21T10:30:00Z"
}

Delivery & Tracking

Resend provides delivery tracking that PROIGN surfaces in the Campaign module:

EventDescriptionSurfaced In
deliveredEmail accepted by recipient's mail serverCampaign analytics
openedRecipient opened the emailCampaign analytics
clickedRecipient clicked a linkCampaign analytics
bouncedEmail could not be delivered (hard or soft bounce)Campaign + Support
complainedRecipient marked as spamCampaign (auto-unsubscribe)

Bounce and complaint events automatically update contact status in the Campaign module — hard-bounced addresses are suppressed, and spam complaints trigger auto-unsubscribe to protect sender reputation.

DNS Configuration

Resend requires DNS records for email authentication. After adding your domain in Resend, add these records to your DNS provider:

RecordTypePurpose
SPFTXTAuthorizes Resend to send on your behalf
DKIMCNAME (×3)Cryptographic signature proving email authenticity
DMARCTXTPolicy for handling emails that fail SPF/DKIM checks

All three records are required for reliable delivery. Missing DKIM or DMARC records will cause emails to land in spam or be rejected entirely.

Queue Architecture

All emails flow through Cloudflare Queues for reliability and rate control:

  • Transactional priority — Ticket replies, shipping confirmations, and password resets are processed immediately
  • Campaign batching — Bulk sends are throttled to stay within Resend rate limits (varies by plan)
  • Automatic retry — Failed sends are retried with exponential backoff (3 attempts over 15 minutes)
  • Dead letter queue — Permanently failed emails are logged for review in the Campaign module

Troubleshooting

Emails Not Sending

  • Verify your domain is confirmed in Resend
  • Check the API key has sending permissions
  • Review the email-worker queue logs for errors

High Bounce Rate

  • Clean your contact lists in the Campaign module
  • Ensure SPF, DKIM, and DMARC records are correctly configured
  • Avoid sending to purchased or unverified email lists

Related