> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: emailMember(emailId: string, memberId: string, options: TriggeredEmailOptions)

# Method package: wixCrmBackend

# Method menu location: wixCrmBackend --> TriggeredEmails --> emailMember

# Method Link: https://dev.wix.com/docs/velo/apis/wix-crm-backend/triggered-emails/email-member.md

# Method Description:

Sends a triggered email to a site member.

The `emailMember()` function returns a Promise
that resolves when the triggered email is sent to the specified site member.

> **Note:**
> This function replaces the deprecated
> `wixUsersBackend.emailUser()`.
> The deprecated function will continue to work, but it will not receive updates.

 To learn more about triggered emails, see:

 - [About Triggered Emails](https://support.wix.com/en/article/about-triggered-emails)
 - [Creating a Triggered Email](https://support.wix.com/en/article/creating-a-triggered-email)
 - [How to Send a Triggered Email to Members with Code](https://support.wix.com/en/article/how-to-send-a-triggered-email-to-members-with-code)

 Before using the `emailMember()` function, you need to set up at least 1
 triggered email.

 Specify which email to send by passing the email's ID in the `emailId` parameter.

 Specify which member the email is sent to by passing the member's ID in the `memberId`
 parameter.

 If the specified triggered email contains
 variables,
 you can pass values for those variables using the optional `options` parameter.
 You pass a `variables` object
 which contains the values to be inserted into your email in place of the variables
 defined in that email. The values passed must be strings. If `variables`
 does not contain a `key:value` pair for a
 variable in your triggered email, the fallback value defined when creating
 your triggered email is inserted in place of the variable.

 > __Notes:__
 > + The statistics for Triggered Emails are based on every time an email is sent,
 >   including test emails that you send to yourself.
 >   This is different from the 
 >   [statistics for Email Marketing](https://support.wix.com/en/article/viewing-your-email-marketing-statistics) 
 >   that are based on emails sent to unique contacts. Therefore, the statistics for Triggered 
 >   Emails may seem inflated compared to Email Marketing statistics.
 > + Triggered Emails generates a code snippet for each of your email
 >   templates. The generated code includes the email's ID and keys for all the
 >   email's variable names. You can copy and paste the snippet into your code.
 >   Then, you need to define values for the `memberId` property and for each
 >   variable key. To learn how to use the generated snippet in your code, see
 >   [How to Send a Triggered Email with Code](https://support.wix.com/en/article/how-to-send-a-triggered-email-with-code).



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Send a triggered email to a member

```javascript
import { Permissions, webMethod } from 'wix-web-module';
import { triggeredEmails } from 'wix-crm-backend';

export const myEmailMemberFunction = webMethod(Permissions.Anyone, () => {
  const emailId = "thanks_for_joining";
  const memberId = "78ad23e2-fd34-5a14-9807-d8c2485d1f36";
  const options = {
    variables: {
      firstName: "Jane",
      lastName: "Member"
    }
  }

  return triggeredEmails.emailMember(emailId, memberId, options)
    .then(() => {
      console.log("Email was sent to member");
    })
    .catch((error) => {
      console.error(error);
    });
});
```

---