emailMember( )


Sends a Triggered Email to the currently logged-in site member.

To learn more about Triggered Emails, see:

Before using the emailMember() function, you need to set up at least one 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 user ID in the toUser parameter. You can only send the email to the currently logged-in member. You can get that member's ID using the id property of the currentMember.

If the specified Triggered Email contains variables, you can pass values for those variables using the optional options parameter. You pass a TriggeredEmailOptions 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 the object you pass to the options parameter 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.

Note that 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 toUser 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.

Note: The APIs in wix-crm-frontend are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

Method Declaration
Copy
Method Parameters
emailIdstringRequired

ID of the triggered email to send.


memberIdstringRequired

ID of the currently signed-in member to send the email to.


optionsTriggeredEmailOptions

Variable values to insert into the email.

Was this helpful?
Yes
No