# Email Integration

## Step 1: Configuring Email at the Business Level

Before setting up email notifications for your campaigns, you need to configure your email account at the business level. Follow these steps:

1. **Navigate to Business Settings**:

   * Go to `Profile > Business Setting`.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FSfXHFAreuEzO7r77jh4B%2F1.png?alt=media&#x26;token=52b9e0a4-ec9c-4020-8410-819f1f8966cb" alt=""><figcaption></figcaption></figure>

   * Click on `Email Account`.
2. **Add Your Email Account**:

   * Click on `Add Email Account`.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2Fh0S5kbQAFpCwhmWcJtkt%2Fimage2.png?alt=media&#x26;token=72468c98-446f-4cd5-947a-341d915879ec" alt=""><figcaption></figcaption></figure>

   * Enter your email account details.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FUJ4bDUHztRjchK9WIx0z%2Fimage15.png?alt=media&#x26;token=3a3f2074-dc52-4136-a7cf-ca48a0f54bd5" alt=""><figcaption></figcaption></figure>

   * Test the SMTP configuration to ensure it works successfully. \[[Detail setup doc](https://docs.gamifyroute.com/kb/business-settings/email-account)]
   * Once the configuration is successful, your email account will be connected to your workspace.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FWMj9llLJXRecxIZibBtt%2Fimage6.png?alt=media&#x26;token=bb4b62fe-9471-4c53-9c46-428c27d49e98" alt=""><figcaption></figcaption></figure>

## Step 2: Configuring Email at the Campaign Level

Once the email account is configured at the business level, you can proceed to configure it for specific campaigns.

1. **Navigate to Campaign Details**:

   * Go to `Campaign > Details`.
   * In the `Details` section, click on `Integration > Email Integration`.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FV4tMlCQiqVDGT5nnw09C%2Fimage3.png?alt=media&#x26;token=54bbda1a-ed44-46af-b9c5-28f124e00bbc" alt=""><figcaption></figcaption></figure>
2. **Connect Your Email Account**:

   * Click on `Connect`.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FkPe45nDgbIjKKTgQz6DZ%2Fimage13.png?alt=media&#x26;token=b11188db-f094-4f31-83c0-3c9c87721f41" alt=""><figcaption></figcaption></figure>

   * Select the email account you previously configured.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2Fj5Sa4u7bqM4Ki25oeZIr%2Fimage14.png?alt=media&#x26;token=6f955892-b858-4533-ae56-9b77925f2b6f" alt=""><figcaption></figcaption></figure>

   * This account will be used to send emails from within the campaign.
3. **Set Up Email Notifications**: Gamify Route offers two types of email notifications:

**Note:** Emails will only be sent if the system detects an email field in the opt-in or claim form; without this field, sending an email is not possible.

* **End-user notification**: This is configured on the left side and is used to notify users when they perform certain actions.
* **Self-notification**: This is configured on the right side and is used to notify yourself when a user performs an event.

<figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FxwnolzWDdtsdOP3Dti0y%2Fimage5.png?alt=media&#x26;token=81d6b92d-33ba-44c6-bd88-b09e1ff08c98" alt=""><figcaption></figcaption></figure>

* **Opt-in**: This event triggers only after the opt-in form is submitted.
* **Winner**: This event triggers only when someone wins.
* **Loser**: This event triggers only when someone loses.
* **Event Completion**: This event triggers only when the user reaches the thank-you page.

#### To send an email to a user who wins a reward:

* Select `Event Completion Notification (For your end-user)` and click on `Configure`.

<figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FSAYkzJo8OuvJyMZjpB7z%2Fimage9.png?alt=media&#x26;token=5837942d-e3e4-4ac8-89d3-1e60d8566ecb" alt=""><figcaption></figcaption></figure>

* Note: This event only triggers an email when the user reaches the thank-you page.

## Step 3: Customizing the Event Completion Notification

1. **Compose Your Email**:

   * In the Event Completion Notification screen, write the email that will be sent to the users.
   * Use the `Merge Tags` option to insert dynamic fields such as the user's first name, last name, reward name, etc.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FQfM42QdHXwIBmNemYW8c%2Fimage11.png?alt=media&#x26;token=8b05dd9a-0734-445c-8378-cb6dea112fa7" alt=""><figcaption></figcaption></figure>

   * You can write an email in the body as per your requirement.
2. **Enable the Email Notification**:

   * Ensure the `Status` field is checked (enabled). This will activate the email-sending feature.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FwUoQhOZix2ks4xaPL4dV%2Fimage4.png?alt=media&#x26;token=026dc835-c204-4dd7-9642-d517a5085bf9" alt=""><figcaption></figcaption></figure>

   * Click on `Save` once your email is configured.
3. **Verify the Configuration**:

   * Go back to the Email Notification section and confirm that the status is set to active.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FqscjMKSgnwLr3KESLVd9%2Fimage1.png?alt=media&#x26;token=dcc95d33-a103-4b94-8794-422dcd89e168" alt=""><figcaption></figcaption></figure>

   * To test the email, make the campaign live.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FTIUq0E6TJmiSTxGtg9Jn%2Fimage12.png?alt=media&#x26;token=045dcafb-abd9-4f38-948d-2d2e8cfc3a55" alt=""><figcaption></figcaption></figure>

   * And simulate the user experience by accessing the campaign's live URL.
4. **Example**:

   * If your opt-in field is the user's first name and the reward is "Buy One Get One", the email will dynamically display these details to the user.

   <figure><img src="https://2433803393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpavEzBU30M4JenpiGJBP%2Fuploads%2FeLtFK53uT7mgcXlIR5JK%2Fimage8.png?alt=media&#x26;token=0c38fd8d-4e14-4ef5-921b-baa8e1fed300" alt=""><figcaption></figcaption></figure>

### Troubleshooting

If you encounter any issues during this process, please contact our support team at <support@gamifyroute.com>.

### Conclusion

By following these steps, you can effectively integrate and configure email notifications in Gamify Route, ensuring your users are promptly notified when they win rewards. This enhances the overall user experience and helps maintain engagement with your campaigns.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gamifyroute.com/kb/campaign-details/integrations/email-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
