Skip to content

Conversation

@andrewtdiz
Copy link
Contributor

@andrewtdiz andrewtdiz commented Jul 17, 2025

Add opt-in support for email.clicked events

This is a PR for Issue #4

Adds opt-in support for email.clicked events (defaults to false).

Click Event Data Structure

As per Resend Docs

click: {
      ipAddress: string
      link: string
      timestamp: string
      userAgent: string
}

Usage

To enable click tracking, set handleClick: true when creating the Resend component:

import { Resend } from "@convex-dev/resend";

const resend = new Resend(components.resend, {
  handleClick: true, // Enable click tracking
  // ... other options
});

Database Impact

  • New emailClicks table for storing click event data

    • Indexed by Id<emails>
  • Updated emails table with clicks array field


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant