Skip to content

Send confirmation emails to consumers with Resend

Connect Resend so each consumer is added as a contact and receives a confirmation email when their lead sells, waits on a buyer, or is not matched.

Integrations11 min readUpdated

This article shows you how to connect Resend so consumers who submit a lead form get a confirmation email that names the company that will call them, or tells them honestly that no match was found yet.

Datahubb adds the consumer to Resend as a contact and fires a lead event. The email itself is written and sent by an Automation in your Resend account, so you can change the wording in Resend at any time without touching Datahubb.

Prerequisites

  • The Integrations feature on your Datahubb plan
  • Admin access to Integrations and to the campaign
  • A Resend account with a verified sending domain and an API key that can create contacts and send events
  • One Resend Automation and Template for each lead event you want to email about

How it works

For every lead that finishes processing, Datahubb makes two calls to Resend:

  1. It creates the consumer as a contact, or updates the contact if that email address already exists. An update never resubscribes a consumer who opted out.
  2. It sends the lead event, for example lead_accepted. Your Resend Automation listens for that event name and sends the email.

Each lead gets at most one email per event, however many times the event is triggered.

Emails go out for leads posted through the normal ingest, the post leg of ping/post, Meta Lead Ads, and a manual redistribute. A later decision from a CPA buyer also sends an event. Other paths, such as CSV imports, do not send anything.

On the integrations list, Resend is shown with the type Email Automation.

The lead events

Resend uses the same lead events as Postback triggers, with the same names. A lead fires an event only if you map it in the Events table.

Event When it fires Names a buyer
Lead accepted A buyer bought the lead Yes
Lead stored The lead was kept without being sent to a buyer No
Lead sold Fires alongside either Lead accepted or Lead stored Yes
Lead pending A CPA buyer has the lead and has not confirmed yet Yes
Lead rejected No buyer took the lead No
Lead skipped Every buyer was closed when the lead arrived. Sent instead of Lead rejected No
Lead duplicated The lead was already submitted before No
Lead error Processing failed No
Lead returned A buyer gave back a lead it had bought No
Lead completed processing Once per lead, when the first pass finishes, whatever the outcome No

A few events overlap, so map them with care:

  • Lead sold always fires together with Lead accepted or Lead stored. If you map both, the consumer gets two emails about one sale. Map Lead sold on its own only if you want one "your lead sold" email for every sale.
  • Lead completed processing fires for every lead on top of its status event. Use it only on its own, as a plain "we have your details" acknowledgement.
  • Lead returned is sent only if the consumer was already told about a buyer. A consumer who never heard about a sale does not get a correction.

Configure Resend globally

  1. Open Integrations in the sidebar and click Resend.
  2. On Credentials, paste your Resend API key.
  3. On Settings, review the Events table. Each row pairs a Datahubb lead event on the left with the Resend event name on the right. By default Lead accepted, Lead pending and Lead rejected are mapped, and both sides use the same name, such as lead_accepted.
  4. Rename the right-hand side only if your Resend Automation is triggered by a different name. Remove a row to stop that event sending anything.
  5. Set Contact Fields so email, first_name and last_name point at the right lead fields for your campaigns.
  6. Set Event Payload Fields. These fill the template variables FIRST_NAME, BUYER_NAME and BUYER_PHONE.
  7. Optionally map Contact Properties (see below).
  8. Fill Override Buyer Display Names and Buyer Phone Numbers if you need them (see below).
  9. Click Save Changes.

Expected result: Resend is configured and available to switch on per campaign.

Field or Fixed text

Each row in Contact Properties and Event Payload Fields has a Field or Fixed text switch.

  • Field looks up a lead field with that name, for example first_name.
  • Fixed text sends exactly what you type, the same for every lead. Use it to send a brand or campaign name, for example EasySolar.

A Field row that names a field the campaigns do not have shows a warning under the row. On Contact Properties and Event Payload Fields, that warning blocks the save. Double check the email row in Contact Fields in particular: a typo there means no email is sent for that campaign.

Contact properties and payload fields

The Contact Properties list is read live from your Resend account, so you see each property's type while mapping. Click Refresh to re-read it; otherwise it updates every hour. You can create a new property without leaving Datahubb. Resend accepts three property types: string, number and boolean. Store dates as strings.

Resend keeps one contact per email address, so a contact property holds only the latest value written. If two brands write campaign_name for the same consumer, only the later one survives. Put a campaign or brand name in Event Payload Fields instead, which is frozen into each email. Add a contact property only if you segment contacts in Resend, and prefix it per brand.

A mapped property that was later deleted in Resend is flagged with a Remove button so you can clear it.

These extra fields are available in any mapping:

Field Value
dh_lead_id The lead's id
dh_campaign_id The campaign's id
dh_click_id The click id, if the lead has one
dh_lead_date_local The date the lead arrived in the consumer's own timezone, for example October 1, 2026. Use this one in anything a consumer reads
dh_lead_date_utc The same date in UTC, for records and support lookups
dh_buyer_display_name The buyer name shown to consumers (Resend only)
dh_buyer_did The number the buyer calls from (Resend only)

Show the right buyer name and number

Buyer names in Datahubb are internal labels, so they are never emailed. BUYER_NAME is filled from the first of these that has a value:

  1. A row for that buyer in Override Buyer Display Names
  2. The company name on the buyer's account
  3. Fallback buyer name, which defaults to "one of our verified partners"

Add an override only where the consumer-facing brand differs from the company name, for example Palmetto Solar instead of Palmetto.

Datahubb stores no phone number for buyers, so add each buyer to Buyer Phone Numbers with the number they call from. It is sent exactly as typed, so format it the way the caller ID shows it. A buyer with no number sends BUYER_PHONE as an empty value. Adding a new buyer does not add it to either table.

FIRST_NAME falls back to Fallback first name, which defaults to "there".

Leads that arrive out of hours

When every buyer is closed, Datahubb can send Lead skipped instead of Lead rejected, so the consumer hears "we are still looking" rather than "we could not match you".

  1. Map both Lead skipped and Lead rejected in Events. If Lead rejected is not mapped, the skip is not used and the lead falls back to Lead rejected, or to nothing.
  2. Set Skipped window (hours). The default is 48.

Datahubb checks every hour. If the lead is redistributed and sells within the window, the consumer gets the sale email. If the window passes and the lead is still unsold, Datahubb sends Lead rejected. Either way the consumer gets two emails, and the second one is true when it is sent.

Pending window (hours), default 24, works differently. It controls when Datahubb re-checks a lead still on Lead pending in case the buyer's decision never reached Resend. It is not a deadline: a pending lead is closed by the buyer's own confirmation window.

Turn it on for a campaign

  1. Open the campaign and go to the Integrations tab.
  2. Find the Resend card and switch it on.
  3. Optional: click Override Settings to change any setting for this campaign only.
  4. Save.

An override replaces a whole table, it does not merge rows. If you override Events to rename one event, list every event you still want, or the ones you leave out send nothing. Contact Fields is the exception and fills missing rows from the global setting. A blank override field inherits the global value; it does not switch the setting off.

Test without emailing real consumers

Use Test recipient override (testing only) to send every email to one address of your own.

  1. Enter a single email address in Test recipient override (testing only).
  2. Save. An amber banner shows on the settings screen while it is set.
  3. Send a test lead and check the inbox.
  4. Clear the field when you are done. Normal delivery resumes with the next lead.

The override works in production too. While it holds a value, no consumer on that campaign is emailed. If you set it on the global settings, it applies to every campaign and cannot be cleared per campaign.

A lead sold through a buyer test is announced as "one of our verified partners", because it sells to a test slot rather than a real buyer.

Set up the Resend side

For each event you map:

  1. Create a Template in Resend. Use plain variable names in triple braces, for example {{{BUYER_NAME}}}, and declare every variable on the template with a fallback value.
  2. Create an Automation triggered by the exact event name from the right-hand side of the Events table.
  3. In the Automation's send email step, map each template variable from the event payload, for example BUYER_NAME from event.BUYER_NAME.
  4. Publish the template.

FIRST_NAME, LAST_NAME, EMAIL and UNSUBSCRIBE_URL are reserved by Resend, so use another name such as CONSUMER_NAME for the consumer's first name.

To vary the copy when there is no buyer number, wrap that line in {{{#if BUYER_PHONE}}} and {{{/if}}}.

Expected result

A new lead appears in Resend as a contact, the mapped event is sent, and the consumer receives the email from the matching Automation. Each event shows in the Resend Provider Logs tab on the integration.

Troubleshooting

  • No email at all. Check that Resend is switched on for the campaign and that the lead's event is mapped in Events. A Stored lead sends nothing if only Lead accepted is mapped.
  • Every event says sent but nobody receives anything. Check Test recipient override (testing only) on the campaign and on the global settings.
  • Event sent but no email. The event name does not match the Automation's trigger, the Automation is disabled, or the contact previously unsubscribed. A sent event means Resend accepted it, not that an email went out. Check Resend's email log.
  • The consumer got two emails about one sale. Both Lead accepted (or Lead stored) and Lead sold are mapped. Remove one.
  • The email says "one of our verified partners". The buyer has no override and no company name on its account, or the event does not name a buyer.
  • The email greets the consumer as "there". The mapped first name field is empty on that lead. Check the field names in Contact Fields and Event Payload Fields.
  • The email shows every fallback value. The Automation's send email step does not map the template variables from the event.
  • A mapped property never reaches the contact. The property does not exist in Resend, or the value does not fit its type. Create the property, or map a field whose value fits.
  • "does not exist in Resend" on save. The row you added points at a property Resend does not have. Create it first, or remove the row.
  • The consumer got "we are still matching you" and nothing since. The CPA buyer has not answered yet. The lead resolves when the buyer decides, when an admin redistributes it, or when the buyer's confirmation window closes.
  • A lead sold, was returned, then sold to another buyer, and the second sale was not announced. Each event is sent once per lead. Map Lead returned so the consumer at least hears that the first partner can no longer help.

Frequently asked questions

No. Datahubb adds the consumer to Resend and fires a lead event. The email text and the Automation that sends it live in your Resend account, so you can change them there at any time.

Lead accepted, Lead pending and Lead rejected are mapped by default. The other events are offered in the Events table but send nothing until you add a row for them.

Not for the same event, because each lead gets at most one email per event. Two different events can both send, so avoid mapping Lead sold alongside Lead accepted or Lead stored.

From the Override Buyer Display Names table if the buyer has a row, otherwise from the company name on the buyer's account. If neither exists, the email uses the fallback buyer name.

Enter your own address in Test recipient override on the campaign or global settings. Every email goes to that address until you clear the field, including in production.
Back to Help Center

Comments

No comments yet — be the first to share your thoughts.

Leave a comment

Comments are reviewed before they’re published.