---
title: "Feed the provider's automations"
description: "Send Resend the contact properties and the events you choose, so automations built in its dashboard can send a tip after a first story or a nudge after a quiet week, with no drip code of your own and nothing forwarded unless your code sends it."
canonical_url: "https://nuxt-backend.dev/docs/build/growth/engage/automations"
---
# Feed the provider's automations

> Send Resend the contact properties and the events you choose, so automations built in its dashboard can send a tip after a first story or a nudge after a quiet week, with no drip code of your own and nothing forwarded unless your code sends it.

Version: nuxt-backend 0.6.x · Tab: Build · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

- [API reference](https://nuxt-backend.dev/docs/reference/api/email)
- [Source](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email-lifecycle.ts)

Let whoever writes your lifecycle email build it without a deploy. You send Resend the contact properties and the events you choose, and automations built in its dashboard act on them: a tip two days after a first strip, a nudge after a quiet week.

**What Resend does natively** (checked on 2026-10-25, [Automations](https://resend.com/docs/dashboard/automations/introduction)): automations with a trigger event, delays, waits for another event, conditions, contact updates and run logs. Custom events may carry a schema, and Resend refuses a payload that doesn't match it.

**What the package adds:** contact properties declared as code, `email.automations.track` tied to the account's contact, refusal of billing events, and erasure of the contact with the account. Nothing is forwarded unless your code sends it.

Three ways to send lifecycle email, from most packaged to most yours:

- **The ready-made flows** cover the usual moments, with caps and the sunset rule.
- **An automation** of your own, on this page, when the emails belong to someone who edits them in Resend.
- **A sequence** in your code, versioned and rendered in the reader's language.

## Declare contact properties

An automation's conditions read a contact's properties, such as a plan or a count of strips. Declare them on `setupEmail`, each with its type, or with `{ type, fallback }` for the value a contact without one reads:

```ts [backend/email.ts]
export const email = setupEmail(components, {
  contactProperties: { plan: 'string', strips: 'number' },
})
```

Resend takes `string` and `number` properties, and refuses one it was not told about. `npx nuxt-backend email sync` creates the properties Resend is missing, and `doctor` reports any it still lacks. Set a value where it changes, on the account's contact:

```ts [backend/strips.ts]
await email.contacts.update({ email: ctx.user.email, properties: { strips: count } })
```

## Track an event

Send an event from your own server code when something happens that an automation should hear of:

```ts [backend/strips.ts]
await email.automations.track(ctx, {
  event: 'strip.published',
  userId: ctx.user.id,
  data: { strips: count },
})
```

`email.automations.track(ctx, { event, userId, data })` sends one event to Resend for the account's contact, and the automations listening for it start. Pass `email` in place of `userId` for an address with no account. It takes a mutation's or an action's `ctx`: the event reaches Resend by a job right after, retried a few times, so `track` returns at once. An event a [ready-made flow](https://nuxt-backend.dev/docs/build/growth/engage/lifecycle-emails#what-starts-and-stops-each-flow) names, such as `firstResult`'s, starts and stops that flow too. Then build the automation in Resend's dashboard: on `strip.published`, wait two days, send the tips email.

What it does not do, by design:

- **No event is forwarded on its own.** No backend event reaches Resend unless your code tracks it, and no switch sends them all. Beside the contacts that [topics](https://nuxt-backend.dev/docs/build/email/preferences) keep in step, what leaves your deployment is what you wrote down to send.
- **Billing events are refused.** The billing provider sends its own receipts, renewals and failed-payment emails. A tracked billing event would let an automation send them a second time, or rebuild dunning, so `track` refuses the names of the package's billing events (`billing.*`) and the billing provider's (`order.paid`).
- **The package's own names are reserved.** `lifecycle.*` starts the ready-made flows, and `resend:` is Resend's.

## Respect consent

An automation's email step takes no topic, checks no choice before it sends, and gets no one-click unsubscribe header from the package. Track an event that starts marketing email only for people who opted into its topic, and keep the delays short, since no step checks the topic again before it sends. Give every automation template Resend's unsubscribe placeholder, `{{{RESEND_UNSUBSCRIBE_URL}}}`, and your postal address, as every [marketing email](https://nuxt-backend.dev/docs/build/growth/engage#the-rules-every-marketing-email-follows) has.

## Privacy

A contact's properties and events are personal data Resend keeps. The [Privacy and data inventory](https://nuxt-backend.dev/docs/ship/compliance/privacy) page lists them with Resend. Deleting an account removes its contact, properties and events included ([Send marketing email](https://nuxt-backend.dev/docs/build/growth/engage/announcements#when-a-person-leaves)).

## What happens when…

<table>
<thead>
  <tr>
    <th>
      Situation
    </th>
    
    <th>
      Result
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        track
      </code>
      
       names one of the package's billing events
    </td>
    
    <td>
      Refused as <a href="https://nuxt-backend.dev/docs/reference/backend/errors#invalid_input">
        <code>
          invalid_input
        </code>
      </a>
      
       on <code>
        event
      </code>
      
      , reason <code>
        billing_event
      </code>
      
      : the billing provider sends those emails itself
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        track
      </code>
      
       names a <code>
        lifecycle.
      </code>
      
       or <code>
        resend:
      </code>
      
       event
    </td>
    
    <td>
      Refused as <code>
        invalid_input
      </code>
      
       on <code>
        event
      </code>
      
      , reason <code>
        reserved
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        track
      </code>
      
       names no account and no address
    </td>
    
    <td>
      Refused as <code>
        invalid_input
      </code>
      
       on <code>
        email
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      Resend refuses the event
    </td>
    
    <td>
      Logged as <code>
        email.event_unsent
      </code>
      
      , and not sent again, so no automation starts twice. A rate limit is waited out a few times first.
    </td>
  </tr>
  
  <tr>
    <td>
      A property was never declared, or <code>
        email sync
      </code>
      
       has not created it
    </td>
    
    <td>
      Resend refuses <code>
        email.contacts.update
      </code>
      
      , which throws <code>
        unavailable
      </code>
      
       with the reason <code>
        provider_refused
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      The account has no contact yet
    </td>
    
    <td>
      <code>
        track
      </code>
      
       creates it first, in the app's segment
    </td>
  </tr>
  
  <tr>
    <td>
      Outside <code>
        production
      </code>
    </td>
    
    <td>
      Events still reach Resend: keep development on a Resend team of its own (<a href="https://nuxt-backend.dev/docs/develop/sandboxes">
        Develop on real sandboxes
      </a>
      
      )
    </td>
  </tr>
</tbody>
</table>

## Limits

- **No caps or quiet hours.** An automation you build in Resend sends on its own schedule. The package's `caps` cover only what it sends.
- **string and number properties only.** Resend takes no other types.
- **No topic check at send time.** Gate the event on consent before you track it (above).

## Test it

Track an event from a development deployment for a test contact, such as `delivered+tips@resend.dev`, and read the run in Resend's run log. `npx nuxt-backend inbox delivered+tips@resend.dev` shows the email it sent.

## Related

- [Send lifecycle emails](https://nuxt-backend.dev/docs/build/growth/engage/lifecycle-emails): the ready-made flows, and sequences as code.
- [Let people choose their emails](https://nuxt-backend.dev/docs/build/email/preferences): the topics an automation's emails should respect.
- [Notify people about your own events](https://nuxt-backend.dev/docs/build/email/notifications/custom-events): your events in the app's own inbox.
- [Resend](https://nuxt-backend.dev/docs/services/resend): the account, the API key and the sending domain.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
