# Sending a triggered email to a user

**URL:** <https://forum.wixstudio.com/t/sending-a-triggered-email-to-a-user/40366>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [June 16, 2021, 2:33pm UTC](https://forum.wixstudio.com/t/sending-a-triggered-email-to-a-user/40366 "2021-06-16T14:33:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon9978](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/simon9978/32/28481_2.png) [@simon9978](https://forum.wixstudio.com/u/simon9978)\
**Post date:** [June 16, 2021, 2:33pm UTC](https://forum.wixstudio.com/t/sending-a-triggered-email-to-a-user/40366/1 "2021-06-16T14:33:04Z")

</div>

I am trying to generate an email to the admin of a site I’m developing.

Shouldn’t this line do the trick?

```javascript
      wixCRM.emailContact('XxxXxXx', 'e1d1r4yt-r4af-42a2-851a-b3420e835438');

```

I modified the fields above, for privacy, but the triggered email ID is right and the contactid came straight from the PrivateMembersData collection.

The code appears to be executed, as the next line after it executes fine but I get no email. It’s not generating any errors. I am also importing wixUsers and wixCRM at the top of the page…so it’s not that.

Can anyone suggest what else I could try?

Simon.

---

<div class="post-metadata">

**Author:** ![simon9978](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/simon9978/32/28481_2.png) [@simon9978](https://forum.wixstudio.com/u/simon9978)\
**Post date:** [June 17, 2021, 9:57am UTC](https://forum.wixstudio.com/t/sending-a-triggered-email-to-a-user/40366/2 "2021-06-17T09:57:08Z")

</div>

Figured it out now

```javascript
wixUsers.emailUser("SaxXxxx", 'e1d1r4yt-r4af-42a2-851a-b3420e835438');

```

Grab the ID from PrivateMembersData. Duplicate this line to send to other email addresses also.

Header must include:

```javascript
import wixUsers from 'wix-users';

```

---

<div class="post-metadata">

**Author:** ![anon72313111](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@anon72313111](https://forum.wixstudio.com/u/anon72313111)\
**Post date:** [June 17, 2021, 11:03am UTC](https://forum.wixstudio.com/t/sending-a-triggered-email-to-a-user/40366/3 "2021-06-17T11:03:24Z")

</div>

Hi Simon,

To avoid confusion, the code must be like this:

```javascript
wixUsers.emailUser(email_id, user_id);

```

Where “email\_id” is the ID from the Triggered emails, and “user\_id” is the ID of the site member who’s intended to receive the email.

For more details please observe the emailUser( ) API.

Ahmad
