---
title: "nuxt-backend/email"
description: "Every export of nuxt-backend/email, with its signature and where it is defined."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/email"
---
# nuxt-backend/email

## Interfaces

### EmailMessage

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

A rendered email. `to` travels with the message because the template knows
the recipient: the invitation goes to the invitee, the gift to its
recipient.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="to">
        
      </a>
      
       <code>
        to
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subject">
        
      </a>
      
       <code>
        subject
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="html">
        
      </a>
      
       <code>
        html?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="text">
        
      </a>
      
       <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailBrand

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

The app a message is sent for. `url` is `SITE_URL`; `name` is
`setupEmail`'s `brand.name`, or the site's host without one.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="name">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="url">
        
      </a>
      
       <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailRenderContext

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

What every template renders with, beside its own data.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="t">
        
      </a>
      
       <code>
        t
      </code>
    </td>
    
    <td>
      <a href="#translate">
        <code>
          Translate
        </code>
      </a>
    </td>
    
    <td>
      The package's labels, filled in: <code>
        t('email.welcome.subject')
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="locale">
        
      </a>
      
       <code>
        locale
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The recipient's locale. English (<code>
        'en'
      </code>
      
      ) until the account says otherwise.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="brand">
        
      </a>
      
       <code>
        brand
      </code>
    </td>
    
    <td>
      <a href="#emailbrand">
        <code>
          EmailBrand
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### OtpEmailData

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Data for the `otp` template.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="email">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="otp">
        
      </a>
      
       <code>
        otp
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="type">
        
      </a>
      
       <code>
        type
      </code>
    </td>
    
    <td>
      <a href="#otppurpose">
        <code>
          OtpPurpose
        </code>
      </a>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="reason">
        
      </a>
      
       <code>
        reason?
      </code>
    </td>
    
    <td>
      <code>
        "email-change"
      </code>
    </td>
    
    <td>
      Why the code was sent, where its type alone doesn't say: <code>
        'email-change'
      </code>
      
       for the <code>
        email-verification
      </code>
      
       code that confirms the current address at the start of an email change.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailChangedEmailData

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Data for the `emailChanged` template.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="email-1">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The address the account had: the notice goes there.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="newemail">
        
      </a>
      
       <code>
        newEmail
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The address it has now, as the person typed it: escape it in HTML (<a href="#escapehtml">
        escapeHtml
      </a>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### WelcomeEmailData

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Data for the `welcome` template.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="email-2">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name-1">
        
      </a>
      
       <code>
        name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The name the person signed up with: their own text, so escape it in HTML (<a href="#escapehtml">
        escapeHtml
      </a>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### DeleteAccountEmailData

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Data for the `deleteAccount` template.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="email-3">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="url-1">
        
      </a>
      
       <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### InviteEmailData

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Data for the `invite` template.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="email-4">
        
      </a>
      
       <code>
        email
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="url-2">
        
      </a>
      
       <code>
        url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="invitername">
        
      </a>
      
       <code>
        inviterName
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The inviter's own name: user text, so escape it in HTML (<a href="#escapehtml">
        escapeHtml
      </a>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="inviteremail">
        
      </a>
      
       <code>
        inviterEmail
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="organizationname">
        
      </a>
      
       <code>
        organizationName
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The workspace's name, as a member typed it: escape it in HTML.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="role">
        
      </a>
      
       <code>
        role
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### GiftEmailData

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Data for the `gift` template. It names who sent what and links to the app,
nothing more: the purchaser's email and their message stay out of the
email, and the link carries no token — the recipient signs in to claim.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="recipientemail">
        
      </a>
      
       <code>
        recipientEmail
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="purchasername">
        
      </a>
      
       <code>
        purchaserName?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The sender's name: at most 40 characters with links and domains taken out, but still their own text, so escape it in HTML (<a href="#escapehtml">
        escapeHtml
      </a>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="item">
        
      </a>
      
       <code>
        item
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      What the gift is: the credit pack's product name.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="claimurl">
        
      </a>
      
       <code>
        claimUrl
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The app URL where the recipient signs in (or up) to receive the gift.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailTemplates

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Every email the package sends, as a template. A template returns the
message or a promise of it, so an async renderer (`@vue-email/render`,
`@react-email/render`) works as is.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="otp-1">
        
      </a>
      
       <code>
        otp
      </code>
    </td>
    
    <td>
      (<code>
        data
      </code>
      
      , <code>
        context
      </code>
      
      ) => | <a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
       | <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      A one-time code: for sign-in, for verifying an address (<code>
        email-verification
      </code>
      
      , which also confirms the current address at the start of an email change), and for the new address of an email change (<code>
        change-email
      </code>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="emailchanged">
        
      </a>
      
       <code>
        emailChanged
      </code>
    </td>
    
    <td>
      (<code>
        data
      </code>
      
      , <code>
        context
      </code>
      
      ) => | <a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
       | <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      Tells the old address that an email change went through.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="welcome">
        
      </a>
      
       <code>
        welcome
      </code>
    </td>
    
    <td>
      (<code>
        data
      </code>
      
      , <code>
        context
      </code>
      
      ) => | <a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
       | <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      Sent once, right after an account is created.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="deleteaccount">
        
      </a>
      
       <code>
        deleteAccount
      </code>
    </td>
    
    <td>
      (<code>
        data
      </code>
      
      , <code>
        context
      </code>
      
      ) => | <a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
       | <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      The confirmation link before an account is deleted.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="invite">
        
      </a>
      
       <code>
        invite
      </code>
    </td>
    
    <td>
      (<code>
        data
      </code>
      
      , <code>
        context
      </code>
      
      ) => | <a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
       | <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      A workspace invitation with its accept link.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="gift">
        
      </a>
      
       <code>
        gift
      </code>
    </td>
    
    <td>
      (<code>
        data
      </code>
      
      , <code>
        context
      </code>
      
      ) => | <a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
       | <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      Tells a gift's recipient it is paid and waiting for them.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts" rel="nofollow">
        src/convex/email-templates.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailComponents

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

The component handle `setupEmail` reads from your generated `components`
object: the package's all-in-one `backend` component, whose email functions
the app reaches as `components.backend.email.*` (see
`src/convex/components/backend/email.ts`). Pass the whole `components`
object — the key is picked structurally.

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="backend">
        
      </a>
      
       <code>
        backend
      </code>
    </td>
    
    <td>
      { <code>
        email
      </code>
      
      : { <code>
        send
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , <a href="#sendemailoptions">
        <code>
          SendEmailOptions
        </code>
      </a>
      
      , <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >; <code>
        status
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >; <code>
        get
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#emailrecord">
        <code>
          EmailRecord
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >; <code>
        cancel
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        null
      </code>
      
      >; <code>
        cleanup
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        olderThanMs?
      </code>
      
      : <code>
        number
      </code>
      
      ; }, <code>
        null
      </code>
      
      >; <code>
        cleanupAbandoned
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        olderThanMs?
      </code>
      
      : <code>
        number
      </code>
      
      ; }, <code>
        null
      </code>
      
      >; <code>
        handleWebhook
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "action"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        body
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        headers
      </code>
      
      : <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
      >; }, { <code>
        status
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        body
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        type?
      </code>
      
      : <code>
        string
      </code>
      
      ; }>; <code>
        inbox
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        address
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#sandboxmessage">
        <code>
          SandboxMessage
        </code>
      </a>
      
      <span>
        
      </span>
      
      >; }; <code>
        webhooks
      </code>
      
      : <code>
        WebhookLogRefs
      </code>
      
      ; }
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email
      </code>
    </td>
    
    <td>
      { <code>
        send
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , <a href="#sendemailoptions">
        <code>
          SendEmailOptions
        </code>
      </a>
      
      , <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >; <code>
        status
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >; <code>
        get
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#emailrecord">
        <code>
          EmailRecord
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >; <code>
        cancel
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        null
      </code>
      
      >; <code>
        cleanup
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        olderThanMs?
      </code>
      
      : <code>
        number
      </code>
      
      ; }, <code>
        null
      </code>
      
      >; <code>
        cleanupAbandoned
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        olderThanMs?
      </code>
      
      : <code>
        number
      </code>
      
      ; }, <code>
        null
      </code>
      
      >; <code>
        handleWebhook
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "action"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        body
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        headers
      </code>
      
      : <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
      >; }, { <code>
        status
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        body
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        type?
      </code>
      
      : <code>
        string
      </code>
      
      ; }>; <code>
        inbox
      </code>
      
      : <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        address
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#sandboxmessage">
        <code>
          SandboxMessage
        </code>
      </a>
      
      <span>
        
      </span>
      
      >; }
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.send
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , <a href="#sendemailoptions">
        <code>
          SendEmailOptions
        </code>
      </a>
      
      , <code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.status
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.get
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#emailrecord">
        <code>
          EmailRecord
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.cancel
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        emailId
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.cleanup
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        olderThanMs?
      </code>
      
      : <code>
        number
      </code>
      
      ; }, <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Retention pruning of the provider component's email records.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.cleanupAbandoned
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "mutation"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        olderThanMs?
      </code>
      
      : <code>
        number
      </code>
      
      ; }, <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.handleWebhook
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "action"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        body
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        headers
      </code>
      
      : <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
      >; }, { <code>
        status
      </code>
      
      : <code>
        number
      </code>
      
      ; <code>
        body
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        type?
      </code>
      
      : <code>
        string
      </code>
      
      ; }>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.email.inbox
      </code>
    </td>
    
    <td>
      <a href="https://docs.convex.dev/api/modules/server#functionreference" rel="nofollow">
        <code>
          FunctionReference
        </code>
      </a>
      
      <<code>
        "query"
      </code>
      
      , <code>
        "internal"
      </code>
      
      , { <code>
        address
      </code>
      
      : <code>
        string
      </code>
      
      ; }, <a href="#sandboxmessage">
        <code>
          SandboxMessage
        </code>
      </a>
      
      <span>
        
      </span>
      
      >
    </td>
    
    <td>
      The sandbox inbox (test mode only).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        backend.webhooks
      </code>
    </td>
    
    <td>
      <code>
        WebhookLogRefs
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### SandboxMessage

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

A message in a sandbox inbox: what test mode sent to one of the provider's
sandbox addresses (`delivered+label@resend.dev`) within the last hour.
Part of the experimental sandbox inbox (`useSandboxInbox`, STABILITY.md).

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="from">
        
      </a>
      
       <code>
        from
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subject-1">
        
      </a>
      
       <code>
        subject
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="text-1">
        
      </a>
      
       <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="html-1">
        
      </a>
      
       <code>
        html?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="receivedat">
        
      </a>
      
       <code>
        receivedAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      When it was sent, as epoch ms.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailStatus

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

A sent email's delivery state, as the component `status` query returns it.

#### Extended by

- [`EmailRecord`](#emailrecord)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="status">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="errormessage">
        
      </a>
      
       <code>
        errorMessage
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="bounced">
        
      </a>
      
       <code>
        bounced
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="complained">
        
      </a>
      
       <code>
        complained
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="failed">
        
      </a>
      
       <code>
        failed
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="deliverydelayed">
        
      </a>
      
       <code>
        deliveryDelayed
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="opened">
        
      </a>
      
       <code>
        opened
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="clicked">
        
      </a>
      
       <code>
        clicked
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailRecord

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

A sent email's record, as the component `get` query returns it.

#### Extends

- [`EmailStatus`](#emailstatus)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Inherited from
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="status-1">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#status">
        <code>
          status
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="errormessage-1">
        
      </a>
      
       <code>
        errorMessage
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        null
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#errormessage">
        <code>
          errorMessage
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="bounced-1">
        
      </a>
      
       <code>
        bounced
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#bounced">
        <code>
          bounced
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="complained-1">
        
      </a>
      
       <code>
        complained
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#complained">
        <code>
          complained
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="failed-1">
        
      </a>
      
       <code>
        failed
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#failed">
        <code>
          failed
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="deliverydelayed-1">
        
      </a>
      
       <code>
        deliveryDelayed
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#deliverydelayed">
        <code>
          deliveryDelayed
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="opened-1">
        
      </a>
      
       <code>
        opened
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#opened">
        <code>
          opened
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="clicked-1">
        
      </a>
      
       <code>
        clicked
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
      .<a href="#clicked">
        <code>
          clicked
        </code>
      </a>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="from-1">
        
      </a>
      
       <code>
        from
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="to-1">
        
      </a>
      
       <code>
        to
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cc">
        
      </a>
      
       <code>
        cc?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="bcc">
        
      </a>
      
       <code>
        bcc?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subject-2">
        
      </a>
      
       <code>
        subject?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="replyto">
        
      </a>
      
       <code>
        replyTo
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="html-2">
        
      </a>
      
       <code>
        html?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="text-2">
        
      </a>
      
       <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="template">
        
      </a>
      
       <code>
        template?
      </code>
    </td>
    
    <td>
      { <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        variables?
      </code>
      
      : <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
      >; }
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        template.id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        template.variables?
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="headers">
        
      </a>
      
       <code>
        headers?
      </code>
    </td>
    
    <td>
      { <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        value
      </code>
      
      : <code>
        string
      </code>
      
      ; }<span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="createdat">
        
      </a>
      
       <code>
        createdAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      When it was queued, as epoch ms.
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="finalizedat">
        
      </a>
      
       <code>
        finalizedAt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      When it reached a final state (delivered, bounced, failed, cancelled), as epoch ms — a far-future sentinel while it is still in flight.
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailEventData

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

`email.*` payload data (documented fields + open for provider additions).

#### Indexable

```ts
[key: string]: unknown
```

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="email_id">
        
      </a>
      
       <code>
        email_id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="from-3">
        
      </a>
      
       <code>
        from?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="to-3">
        
      </a>
      
       <code>
        to?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subject-4">
        
      </a>
      
       <code>
        subject?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="created_at">
        
      </a>
      
       <code>
        created_at?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="broadcast_id">
        
      </a>
      
       <code>
        broadcast_id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="bounce">
        
      </a>
      
       <code>
        bounce?
      </code>
    </td>
    
    <td>
      { <code>
        type?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        subType?
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        message?
      </code>
      
      : <code>
        string
      </code>
      
      ; }
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bounce.type?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bounce.subType?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bounce.message?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### ContactEventData

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

`contact.*` payload data.

#### Indexable

```ts
[key: string]: unknown
```

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id">
        
      </a>
      
       <code>
        id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="segment_ids">
        
      </a>
      
       <code>
        segment_ids?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      The segments the contact belongs to.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="audience_id">
        
      </a>
      
       <del>
        <code>
          audience_id?
        </code>
      </del>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        Deprecated
      </strong>
      
       The provider still sends it; read <code>
        segment_ids
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="email-5">
        
      </a>
      
       <code>
        email?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="first_name">
        
      </a>
      
       <code>
        first_name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="last_name">
        
      </a>
      
       <code>
        last_name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="unsubscribed">
        
      </a>
      
       <code>
        unsubscribed?
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### DomainEventData

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

`domain.*` payload data.

#### Indexable

```ts
[key: string]: unknown
```

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="id-1">
        
      </a>
      
       <code>
        id?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="name-2">
        
      </a>
      
       <code>
        name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="status-2">
        
      </a>
      
       <code>
        status?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailWebhookEvent

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

A verified provider webhook event, as delivered to the typed handlers.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
    
    <th>
      Default type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-t">
        
      </a>
      
       <code>
        T
      </code>
      
       <em>
        extends
      </em>
      
       <a href="#emailwebhookeventtype">
        <code>
          EmailWebhookEventType
        </code>
      </a>
    </td>
    
    <td>
      <a href="#emailwebhookeventtype">
        <code>
          EmailWebhookEventType
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-1">
        
      </a>
      
       <code>
        type
      </code>
    </td>
    
    <td>
      <code>
        T
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="created_at-1">
        
      </a>
      
       <code>
        created_at?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="data">
        
      </a>
      
       <code>
        data
      </code>
    </td>
    
    <td>
      <code>
        EventDataFor
      </code>
      
      <<code>
        T
      </code>
      
      >
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### SetupEmailOptions

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="templates">
        
      </a>
      
       <code>
        templates?
      </code>
    </td>
    
    <td>
      <a href="#emailtemplateoverrides">
        <code>
          EmailTemplateOverrides
        </code>
      </a>
    </td>
    
    <td>
      Restyle any email the package sends, by template name: <code>
        otp
      </code>
      
      , <code>
        welcome
      </code>
      
      , <code>
        deleteAccount
      </code>
      
      , <code>
        invite
      </code>
      
      , <code>
        gift
      </code>
      
      . Each override gets the template's data and its render context, the default included: <code>
        invite: (data, { byDefault }) => ({ ...byDefault(data), subject: 'Join us' })
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="brand-1">
        
      </a>
      
       <code>
        brand?
      </code>
    </td>
    
    <td>
      { <code>
        name?
      </code>
      
      : <code>
        string
      </code>
      
      ; }
    </td>
    
    <td>
      The app the emails are sent for. <code>
        name
      </code>
      
       reaches every template as <code>
        brand.name
      </code>
      
      ; without it, the brand is the host of <code>
        SITE_URL
      </code>
      
      . The packaged emails sign off with it, linked to <code>
        SITE_URL
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        brand.name?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="events">
        
      </a>
      
       <code>
        events?
      </code>
    </td>
    
    <td>
      <a href="#emailwebhookeventhandlers">
        <code>
          EmailWebhookEventHandlers
        </code>
      </a>
    </td>
    
    <td>
      React to any verified provider event, keyed by its event name (<code>
        'email.bounced'
      </code>
      
      , <code>
        'contact.created'
      </code>
      
      , …). Handlers run <strong>
        after
      </strong>
      
       the component has verified the signature and updated delivery status — <code>
        useEmailStatus
      </code>
      
       already reflects the event. A handler throw answers 500, so the provider redelivers (deliveries are deduped once fully processed).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="onunknownevent">
        
      </a>
      
       <code>
        onUnknownEvent?
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        event
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Called for a <strong>
        verified
      </strong>
      
       event whose type is outside the known catalog (a provider newer than this package). Acknowledged 202 either way.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### Email

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="api">
        
      </a>
      
       <code>
        api
      </code>
    </td>
    
    <td>
      { <code>
        getEmailStatus
      </code>
      
      : <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      >; <code>
        getSandboxInbox
      </code>
      
      : <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      >; }
    </td>
    
    <td>
      Ready-made, client-callable functions to re-export from your <code>
        backend/email.ts
      </code>
      
      : <code>
        getEmailStatus
      </code>
      
       (the reactive query behind <code>
        useEmailStatus
      </code>
      
      ) and <code>
        getSandboxInbox
      </code>
      
       (behind <code>
        useSandboxInbox
      </code>
      
      ).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        api.getEmailStatus
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        api.getSandboxInbox
      </code>
    </td>
    
    <td>
      <code>
        RegisteredQuery
      </code>
      
      <<code>
        "public"
      </code>
      
      >
    </td>
    
    <td>
      The messages test mode sent to a sandbox address within the last hour, newest first — for a demo, a preview deployment or an e2e run that has to read a sign-in code without a real mailbox. Public and unauthenticated by design (the visitor is not signed in yet), so knowing an address is enough to read its mail: re-export it only where every account is a throwaway sandbox one. Empty for any other address, and always empty with <code>
        EMAIL_TEST_MODE=false
      </code>
      
      , which captures nothing. Experimental, with <code>
        useSandboxInbox
      </code>
      
       (STABILITY.md).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="send">
        
      </a>
      
       <code>
        send
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        options
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Send a transactional email (call from your own gated action/mutation).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="render">
        
      </a>
      
       <code>
        render
      </code>
    </td>
    
    <td>
      <<code>
        Name
      </code>
      
      >(<code>
        name
      </code>
      
      , <code>
        data
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<a href="#emailmessage">
        <code>
          EmailMessage
        </code>
      </a>
      
      >
    </td>
    
    <td>
      Render one of the package's emails, your override or the packaged default, without sending it: what a preview page or a test shows. Resolves once an async override has rendered.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="sendtemplate">
        
      </a>
      
       <code>
        sendTemplate
      </code>
    </td>
    
    <td>
      <<code>
        Name
      </code>
      
      >(<code>
        ctx
      </code>
      
      , <code>
        name
      </code>
      
      , <code>
        data
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        string
      </code>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Render one of the package's emails and send it.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="status-3">
        
      </a>
      
       <code>
        status
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        emailId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<a href="#emailstatus">
        <code>
          EmailStatus
        </code>
      </a>
      
       | <code>
        null
      </code>
      
      >
    </td>
    
    <td>
      Read an email's delivery status.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cancel">
        
      </a>
      
       <code>
        cancel
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        emailId
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Cancel a not-yet-sent email.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cleanup">
        
      </a>
      
       <code>
        cleanup
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Prune finalized email records (delivered, bounced, cancelled, failed …) older than <code>
        olderThanMs
      </code>
      
       — default 7 days. Schedules the provider's batched cleanup and returns at once; call it from a cron. <strong>
        Example
      </strong>
      
       <code>
        [backend/crons.ts] crons.daily('prune emails', { hourUTC: 3, minuteUTC: 0 }, internal.email.pruneEmails) // internal.email.pruneEmails: internalMutation(ctx => email.cleanup(ctx, { olderThanMs: 7 * DAY }))
      </code>
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cleanupabandoned">
        
      </a>
      
       <code>
        cleanupAbandoned
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        options?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        void
      </code>
      
      >
    </td>
    
    <td>
      Prune abandoned email records — created more than <code>
        olderThanMs
      </code>
      
       ago (default 30 days) and never finalized, e.g. because a delivery webhook never arrived. Scheduled like <code>
        cleanup
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="webhookhandler">
        
      </a>
      
       <code>
        webhookHandler
      </code>
    </td>
    
    <td>
      (<code>
        ctx
      </code>
      
      , <code>
        request
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        Response
      </code>
      
      >
    </td>
    
    <td>
      Handle an email-provider event webhook from your app's <code>
        /email/events
      </code>
      
       HTTP route (inside an <code>
        httpAction
      </code>
      
      ); returns the Response to send back.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="segments">
        
      </a>
      
       <code>
        segments
      </code>
    </td>
    
    <td>
      { <code>
        create
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        list
      </code>
      
      : () => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        remove
      </code>
      
      : (<code>
        id
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        addContact
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        removeContact
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; }
    </td>
    
    <td>
      Marketing segments — the groups a broadcast is sent to. A contact is one record however many segments it sits in: put it in one at creation (<code>
        contacts.add({ email, segments: [{ id }] })
      </code>
      
      ) or later with <code>
        addContact
      </code>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        segments.create
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        segments.list
      </code>
    </td>
    
    <td>
      () => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        segments.remove
      </code>
    </td>
    
    <td>
      (<code>
        id
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        segments.addContact
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Put an existing contact (<code>
        contactId
      </code>
      
       or <code>
        email
      </code>
      
      ) in a segment.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        segments.removeContact
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      Take a contact out of a segment; the contact itself stays.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="contacts">
        
      </a>
      
       <code>
        contacts
      </code>
    </td>
    
    <td>
      { <code>
        add
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        list
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        update
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        remove
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; }
    </td>
    
    <td>
      Marketing contacts: add (subscribe) / list / update / remove (unsubscribe).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contacts.add
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contacts.list
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contacts.update
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        contacts.remove
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="broadcasts">
        
      </a>
      
       <code>
        broadcasts
      </code>
    </td>
    
    <td>
      { <code>
        create
      </code>
      
      : (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; <code>
        send
      </code>
      
      : (<code>
        id
      </code>
      
      , <code>
        payload?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >; }
    </td>
    
    <td>
      Marketing broadcasts: create / send (optionally scheduled).
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        broadcasts.create
      </code>
    </td>
    
    <td>
      (<code>
        payload
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        broadcasts.send
      </code>
    </td>
    
    <td>
      (<code>
        id
      </code>
      
      , <code>
        payload?
      </code>
      
      ) => <code>
        Promise
      </code>
      
      <<code>
        unknown
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Type Aliases

### OtpPurpose

```ts
type OtpPurpose = "sign-in" | "email-verification" | "forget-password" | "change-email";
```

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Which code an OTP email carries; the subject follows it.

---

### EmailTemplateName

```ts
type EmailTemplateName = keyof EmailTemplates;
```

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

A template's name.

---

### EmailTemplateData

```ts
type EmailTemplateData<Name> = Parameters<EmailTemplates[Name]>[0];
```

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

The data a template renders from.

#### Type Parameters

<table>
<thead>
  <tr>
    <th>
      Type Parameter
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="type-parameter-name">
        
      </a>
      
       <code>
        Name
      </code>
      
       <em>
        extends
      </em>
      
       <a href="#emailtemplatename">
        <code>
          EmailTemplateName
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailTemplateOverrides

```ts
type EmailTemplateOverrides = { [Name in EmailTemplateName]?: (data: EmailTemplateData<Name>, context: EmailRenderContext & { byDefault: (data: EmailTemplateData<Name>) => EmailMessage }) => EmailMessage | Promise<EmailMessage> };
```

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Overrides for any template in [EmailTemplates](#emailtemplates). Each gets the same
data and context as the default, and the default itself, already bound to
that context, so an override can keep the packaged body and change only
what it needs:
`invite: (data, { byDefault }) => ({ ...byDefault(data), subject: 'Join us' })`.
An override may be async; the packaged default never is.

---

### SendEmailOptions

```ts
type SendEmailOptions = {
  to: string | string[];
  subject?: string;
  html?: string;
  text?: string;
  from?: string;
  cc?: string | string[];
  bcc?: string | string[];
  replyTo?: string[];
  headers?: {
     name: string;
     value: string;
  }[];
  template?: {
     id: string;
     variables?: Record<string, string | number>;
  };
  idempotencyKey?: string;
};
```

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

Options for a transactional send (mirrors the component `send` mutation).

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="to-2">
        
      </a>
      
       <code>
        to
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="subject-3">
        
      </a>
      
       <code>
        subject?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="html-3">
        
      </a>
      
       <code>
        html?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="text-3">
        
      </a>
      
       <code>
        text?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="from-2">
        
      </a>
      
       <code>
        from?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="cc-1">
        
      </a>
      
       <code>
        cc?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="bcc-1">
        
      </a>
      
       <code>
        bcc?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
       | <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="replyto-1">
        
      </a>
      
       <code>
        replyTo?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
      
      <span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="headers-1">
        
      </a>
      
       <code>
        headers?
      </code>
    </td>
    
    <td>
      { <code>
        name
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        value
      </code>
      
      : <code>
        string
      </code>
      
      ; }<span>
        
      </span>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="template-1">
        
      </a>
      
       <code>
        template?
      </code>
    </td>
    
    <td>
      { <code>
        id
      </code>
      
      : <code>
        string
      </code>
      
      ; <code>
        variables?
      </code>
      
      : <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
      >; }
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        template.id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        template.variables?
      </code>
    </td>
    
    <td>
      <code>
        Record
      </code>
      
      <<code>
        string
      </code>
      
      , <code>
        string
      </code>
      
       | <code>
        number
      </code>
      
      >
    </td>
    
    <td>
      -
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="idempotencykey">
        
      </a>
      
       <code>
        idempotencyKey?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Dedupes the send: a second send with the same key, while the first is still on record, returns the first one's id and delivers nothing.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts" rel="nofollow">
        src/convex/integrations/email.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

---

### EmailWebhookEventType

```ts
type EmailWebhookEventType = typeof ALL_EMAIL_EVENTS[number];
```

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

---

### EmailWebhookEventHandlers

```ts
type EmailWebhookEventHandlers = { [K in EmailWebhookEventType]?: (ctx: AnyActionCtx, event: EmailWebhookEvent<K>) => Promise<void> };
```

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

Per-event email webhook handlers, keyed by the provider's event names —
the complete catalog, uniform with `setupBilling({ events })`.

---

### LabelParams

```ts
type LabelParams = Record<string, string | number>;
```

Defined in: [src/convex/labels.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/labels.ts)

Values a label interpolates. `count` also picks the plural form.

---

### Translate

```ts
type Translate = (key, params?) => string;
```

Defined in: [src/convex/labels.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/labels.ts)

Resolve a label by its dotted key and fill it in.

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        params?
      </code>
    </td>
    
    <td>
      <a href="#labelparams">
        <code>
          LabelParams
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`string`

## Variables

### ALL_EMAIL_EVENTS

```ts
const ALL_EMAIL_EVENTS: readonly ["email.sent", "email.delivered", "email.delivery_delayed", "email.bounced", "email.complained", "email.opened", "email.clicked", "email.failed", "email.scheduled", "email.received", "email.suppressed", "contact.created", "contact.updated", "contact.deleted", "domain.created", "domain.updated", "domain.deleted"];
```

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

The provider's full webhook event catalog: every transactional delivery
state, plus the contact and domain events the marketing surface
(segments/contacts/broadcasts) generates. Broadcast sends surface as
`email.*` events carrying a `broadcast_id`.

## Functions

### escapeHtml()

```ts
function escapeHtml(value): string;
```

Defined in: [src/convex/email-templates.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/email-templates.ts)

Escape text for HTML: `&`, `<`, `>`, `"` and `'`. Every packaged template
runs each value through it; an override that writes its own HTML should do
the same with anything a user typed (a name, a workspace name, a gift
sender's name), or that user can put markup into an email your domain sends.

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        value
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`string`

#### Example

```ts
gift: (data, { byDefault }) => ({ ...byDefault(data), html: `<p>From ${escapeHtml(data.purchaserName ?? 'someone')}</p>` })
```

---

### setupEmail()

```ts
function setupEmail(components, options?): Email;
```

Defined in: [src/convex/integrations/email.ts](https://github.com/qruto/nuxt-backend/blob/main/src/convex/integrations/email.ts)

App-facing email helper over the `backend` component's email module: both
**transactional** email (send / status / cancel + webhook) and **marketing**
email (segments / contacts / broadcasts via the provider SDK). It also
holds the templates of every email the package sends: `setupAuth` and
`setupBilling` take this instance as their `email` option and send through
it, so an override here restyles all of them.

Both use the required `EMAIL_API_KEY` env var. While it's missing (e.g. a
mid-configuration preview), transactional `send` logs instead of delivering.

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        components
      </code>
    </td>
    
    <td>
      <a href="#emailcomponents">
        <code>
          EmailComponents
        </code>
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      <a href="#setupemailoptions">
        <code>
          SetupEmailOptions
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

[`Email`](#email-6)

#### Example

```ts
import { setupEmail } from 'nuxt-backend/email'
import { components } from './_generated/api'

export const email = setupEmail(components, {
  templates: { invite: (data, { byDefault }) => ({ ...byDefault(data), subject: 'Join the team' }) },
})
export const { getEmailStatus } = email.api
```


## Sitemap

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