> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Set Up a Triggered Email ## Article: Creating a Triggered Email ## Article Link: https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/triggered-emails/set-up-a-triggered-email.md ## Article Content: # Set Up a Triggered Email Set up a [triggered email](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/triggered-emails/about-triggered-emails.md) to automatically send customized emails for specific events on your site. ## Step 1 | Navigate to the Triggered Emails dashboard page To access the Triggered Emails dashboard page, you can either: + Select **Developer Tools** from the code sidebar and click **Triggered Emails**. + Select **Developer Tools** from [your site’s dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fdeveloper-tools/triggered-emails) and select **Triggered Emails**. ## Step 2 | Create an email Use the editor to create and design a new email: 1. On your [Triggered Emails dashboard page](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fdeveloper-tools/triggered-emails), click **+ New Campaign** to create a new email, or click the **More Actions** ![](https://d2x3xhvgiqkx42.cloudfront.net/12345678-1234-1234-1234-1234567890ab/149e0d5e-6f90-423d-9f3c-7342557186d1/2018/03/26/3b056efa-d2c8-4cc2-b5fc-1cdfe2770936.png) icon and select **Duplicate** to duplicate an existing triggered email. 2. Design your email in the editor. ## Step 3 (Optional) | Add variables to personalize text Add variables to personalize the text of your email. The variable is a placeholder that will be replaced by a value you define in the code. 1. With a text element selected in the editor, click **+ Add Variable**: ![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/fcaec601e7155d7ffa74cdcb27847d63.png) 2. Fill out the fields in the popup: + **Variable name**: Name the variable something meaningful so it’s easy to identify later. For example, `newSubscriberName`. + **Fallback value**: A replacement text that displays here in case you’re missing that specific piece of data. You can apply fallback values in the body of an email, but not in the subject line. For example, with the fallback value `there`, in a case where you don't have the new subscriber's name the email will fallback to "Hey there,". 3. Click **Add**. ## Step 4 | Test, save, or publish the email Once your email is designed you have the option at the top of the editor to preview, save, or publish the triggered email. ![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/de9b62255dd77d87f3eb37ee25727ff0.png) + Click **Preview & Test** to send yourself the email to see how it will appear in an inbox and to test any links you included in the email. + Click **Save as Draft** to save your email as a work-in-progress and returns you to the [Triggered Emails dashboard page](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fdeveloper-tools/triggered-emails). Draft emails are not sent when the triggering event occurs. + Click **Save & Continue**. If this is the first time ever you're creating a campaign, you'll be asked to fill out [sender details](#step-5-–add-sender-details). That must be completed before publishing. ## Step 5 | Add sender details Sender details are required to send triggered emails. These details contain the information that appears as the sender’s name and email address when an email from your site is received: + **Sender’s name**: This is the name that displays in the recipient's inbox. + **Reply-to email**: This is the email address that will populate as the send-to address in your reader's email when they click Reply.
Important information about the email address included in reply-to email: + Emails sent with a reply-to email with a public domain, such as `@gmail.com` or `@yahoo.com`, tend to land in the spam or promotions category. It's better to use an email address with an authenticated domain, such as `you@yourbusiness.com`. + If you use a public domain address, Wix redirects your email through our own authenticated address `@wixemails.com` or, for free users, `@wixsitemail.com`. When someone replies to your email, their new email will automatically populate the send field with the reply-to email. + You may be asked to confirm your reply-to email. You'll receive an email in your inbox with those instructions.
Click **Save** to continue. ## Step 6 | Get the code snippet Before redirecting back to the [Triggered Emails dashboard page](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fdeveloper-tools/triggered-emails) you have the opportunity to make changes to the email ID and the audience who will receive the email: ![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/9c5d6d3da3f03171968688308d8cc1be.png) 1. Update the unique **Email ID** to one that’s more friendly to work with. For example, `newsletter_signup`. This email ID is used in the code snippet. 2. Click **Email new contacts** or **Email site members** to display the appropriate snippet. 3. Copy the code snippet now or access it later from the [Triggered Emails dashboard page](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fdeveloper-tools/triggered-emails). 4. Click **Save**. ## Step 7 | Add the code snippet to an event on your site Take the code snippet you copied from the previous window or hover over a triggered email in the [Triggered Emails dashboard page](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fdeveloper-tools/triggered-emails) and click the **View code snippet** ![](https://wixmp-833713b177cebf373f611808.wixmp.com/images/fb658cc2897e698b84136109a16fc45c.png) icon and add the snippet to your code. ## See also + [About triggered emails](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/triggered-emails/about-triggered-emails.md) + [Tutorial: Send a triggered email to contacts](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/triggered-emails/sending-a-triggered-email-to-contacts.md) + [Tutorial: Send a triggered email to members](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/triggered-emails/sending-a-triggered-email-to-members.md) + [Tutorial: Send emails using the SendGrid npm package](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-editor-elements/send-emails-using-the-send-grid-npm-package.md)