You need to deliver contextual feature announcements to specific user segments based on their engagement patterns and usage metrics. Resend provides a developer-friendly email API that lets you programmatically send targeted broadcasts to cohorts based on real behavioral data. Use Resend's broadcast and segmentation endpoints to create behavior-driven campaigns that reach the right users at the right adoption stage. Segment users by feature adoption metrics—breadth, depth, and time-to-adopt—then trigger Resend broadcasts to drive engagement in underperforming cohorts.
What this tutorial covers
- •Outcome: You will build a TypeScript application that segments users by feature-adoption metrics and sends targeted Resend broadcasts to each cohort.
- •Endpoints used: `POST /broadcasts`, `POST /broadcasts/559ac32e-9ef5-46fb-82a1-b76b840c0f7b/send`, `POST /contacts/e169aa45-1ecf-4183-9955-b1499d5701d3/segments/78261eea-8f8b-4381-83c6-79fa7120f1cf`
- •Language: typescript
- •Auth: API key (X-Resend-Key header)
- •Estimated implementation time: ~18 minutes
Step 1: Segment users by feature-adoption metrics using Resend
Begin by defining your cohorts based on feature adoption signals: breadth (count of adopters), depth (usage frequency), and time-to-adopt. Use Resend's contact-to-segment API to assign users to adoption-risk buckets before broadcasting.
Assign contacts to adoption segments
1// Section 1: Segment users by feature-adoption metrics using Resend
2// This section establishes the conceptual segmentation strategy.
3// Segments are pre-created in Resend and referenced by ID in subsequent sections.
4// Low adopters, medium users, and high adopters are tracked by feature usage depth.
5const LOW_ADOPTER_SEGMENT_ID = 'low-adopter-segment-id';
6const MEDIUM_ADOPTER_SEGMENT_ID = 'medium-adopter-segment-id';
7const GENERAL_SEGMENT_ID = '78261eea-8f8b-4381-83c6-79fa7120f1cf';
8const SENT_BROADCAST_ID = '559ac32e-9ef5-46fb-82a1-b76b840c0f7b';Response:
1{
2 "object": "broadcast",
3 "id": "559ac32e-9ef5-46fb-82a1-b76b840c0f7b",
4 "name": "Feature Adoption Segment",
5 "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
6 "from": "Acme <onboarding@resend.dev>",
7 "subject": "hello world",
8 "reply_to": null,
9 "preview_text": "Check out our latest announcements",
10 "html": "<p>Hello {{{contact.first_name|there}}}!</p>",
11 "text": "Hello {{{contact.first_name|there}}}!",
12 "status": "draft",
13 "created_at": "2026-12-01T19:32:22.980Z",
14 "scheduled_at": null,
15 "sent_at": null,
16 "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
17}Step 2: Create a targeted feature-adoption broadcast with Resend
Define broadcast content tailored to each adoption cohort—highlight feature benefits relevant to low adopters, deepening guidance for medium users.
Create broadcast campaign
1import { Resend } from 'resend';
2
3const resend = new Resend('re_xxxxxxxxx');
4
5// Low adopters: highlight feature benefits
6const lowAdopterBroadcast = await resend.broadcasts.create({
7 segmentId: 'low-adopter-segment-id',
8 from: 'Acme <onboarding@resend.dev>',
9 subject: 'Discover the Power of [Feature]',
10 html: 'Hi {{{contact.first_name|there}}}, learn how [Feature] saves teams 5+ hours weekly. Get started: {{{RESEND_UNSUBSCRIBE_URL}}}',
11 send: true,
12});
13
14// Medium users: deepening guidance and advanced use cases
15const mediumUserBroadcast = await resend.broadcasts.create({
16 segmentId: 'medium-adopter-segment-id',
17 from: 'Acme <onboarding@resend.dev>',
18 subject: 'Level Up: Advanced [Feature] Techniques',
19 html: 'Hi {{{contact.first_name|there}}}, unlock expert workflows with [Feature] automation. Deep dive: {{{RESEND_UNSUBSCRIBE_URL}}}',
20 send: true,
21});
22
23// Bridge: capture broadcast IDs for downstream tracking
24const lowAdopterBroadcastId = lowAdopterBroadcast?.data?.id;
25const mediumUserBroadcastId = mediumUserBroadcast?.data?.id;
26console.log('Low adopter broadcast ID:', lowAdopterBroadcastId);
27console.log('Medium user broadcast ID:', mediumUserBroadcastId);Response:
1{
2 "object": "broadcast",
3 "id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794",
4 "name": "Feature Adoption Campaign",
5 "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
6 "from": "Acme <onboarding@resend.dev>",
7 "subject": "Introducing Feature X",
8 "preview_text": "Learn how to use our latest feature",
9 "html": "<p>Hello {{{contact.first_name|there}}}!</p>",
10 "text": "Hello {{{contact.first_name|there}}}!",
11 "status": "draft",
12 "created_at": "2026-12-01T19:32:22.980Z",
13 "scheduled_at": null,
14 "sent_at": null,
15 "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
16}Step 3: Send the broadcast to all segmented contacts via Resend
Trigger the broadcast send to all contacts in the target segment, leveraging Resend's infrastructure to bypass spam filters and ensure reliable delivery.
Send broadcast to segment
1// Section 3: Send the broadcast to all segmented contacts via Resend
2// Reusing the already-imported resend instance and segment ID from prior sections
3const segmentId = '78261eea-8f8b-4381-83c6-79fa7120f1cf';
4
5const { data, error } = await resend.broadcasts.create({
6 segmentId: segmentId,
7 from: 'Acme <onboarding@resend.dev>',
8 subject: 'hello world',
9 html: 'Hi {{{contact.first_name|there}}}, you can unsubscribe here: {{{RESEND_UNSUBSCRIBE_URL}}}',
10 send: true,
11});
12
13if (error) {
14 console.error('Broadcast send failed:', error);
15} else {
16 console.log('Broadcast sent to segment:', data.id);
17}
18
19// Bridge: store the general broadcast ID for retrieval in the next section
20const generalBroadcastId = data?.id ?? '559ac32e-9ef5-46fb-82a1-b76b840c0f7b';Response:
{
"id": "49a3999c-0ce1-4ea6-ab68-afcd6dc2e794"
}Step 4: Track adoption outcomes and iterate campaigns with Resend insights
After broadcasts are sent via Resend, monitor open rates, click-through patterns, and feature-adoption metrics to refine your next cohort campaigns. Use behavioral signals—post-email logins, feature usage depth—to identify which adoption cohorts responded and which need reactivation messaging.
Monitor and iterate adoption campaigns
1// Section 4: Track adoption outcomes and iterate campaigns with Resend insights
2// Using the resend instance and broadcast ID threaded from prior sections
3
4// Retrieve broadcast performance metrics
5const { data: broadcast, error } = await resend.broadcasts.get(
6 '559ac32e-9ef5-46fb-82a1-b76b840c0f7b',
7);
8
9if (broadcast && broadcast.status === 'sent') {
10 console.log('Campaign sent. Monitoring open rates, clicks, and adoption signals...');
11 // Check post-email logins and feature usage depth from behavioral data
12 const adoptionCohorts = broadcast.segment_id;
13 console.log(`Refining cohort ${adoptionCohorts} based on engagement patterns`);
14}
15
16// Create reactivation message for low-engagement cohorts
17const { data: reactivation, error: reactivationError } = await resend.broadcasts.create({
18 segmentId: broadcast?.segment_id || '78261eea-8f8b-4381-83c6-79fa7120f1cf',
19 from: 'Acme <onboarding@resend.dev>',
20 subject: 'We miss you! Re-engage with our latest features',
21 html: 'Hi {{{contact.first_name|there}}}, based on your usage patterns, we have new features tailored for you. {{{RESEND_UNSUBSCRIBE_URL}}}',
22 send: true,
23});
24
25if (reactivationError) {
26 console.error('Reactivation broadcast failed:', reactivationError);
27} else {
28 console.log('Reactivation broadcast sent. ID:', reactivation?.id);
29}The evaluation function logs whether the adoption cohort needs a follow-up broadcast and suggests the next iteration strategy—whether a different message angle, format, or timing via Resend will drive better feature adoption.
Common pitfalls when using Resend
- •Treating all broadcasts as one-size-fits-all. Generic feature announcements sent to all users ignore adoption-stage differences. Lifecycle marketing best practice demands behavior-triggered, context-specific messages at distinct stages (activation, engagement, retention). Tailor your Resend broadcast copy and CTAs to each cohort's adoption profile.
- •Ignoring adoption breadth, depth, and velocity metrics. Adoption rate alone is insufficient. Track breadth (how many adopt), depth (usage frequency), and time-to-adopt. Use these dimensions to identify cohorts materially below target, then design Resend interventions for each tier rather than waiting for a crisis.
- •Sending broadcasts on fixed cadences instead of signals. Lifecycle marketing warns against "Tuesday is email day" campaigns. Behavior-triggered broadcasts—linked to low login frequency, zero feature usage, or churn risk signals—are more effective than fixed schedules. Use Resend's segmentation to trigger adoption campaigns off usage data, not calendar dates.
- •Not A/B testing or iterating on open and click signals. One-off broadcasts don't improve retention. Cohort analytics and iterative A/B tests reveal which adoption messaging, subject lines, and CTAs resonate. Monitor Resend delivery metrics and feature-adoption outcomes, then quickly rotate underperforming broadcasts with new variations.
Ready to drive feature adoption at scale? Get started with Resend today and build behavior-triggered email campaigns that move the needle on engagement.
Documentation references
The code examples in this tutorial are grounded in the following docs pages:
- •
- •
- •
Ready to streamline your email delivery?
Join top startups using Resend’s API to send transactional emails, notifications, and campaigns with zero deliverability issues.
Read More Blog Posts
Send domain-verified transactional alerts for subscription events
Subscription renewals and payment failures demand reliable, immediate email delivery without landing in spam folders. Resend is an email delivery platform built
Build automated multi-step onboarding email sequences with Resend
Manually sending welcome and follow-up emails to new users doesn't scale and loses engagement without proper segmentation and timing. Resend is an email API pla

