> ## Documentation Index
> Fetch the complete documentation index at: https://watermelon.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Receive emails with Agent conversations

> Forward Agent conversations that need a human follow-up to your email inbox.

<Info>
  Human Handover via Zapier is available on the following plans: Advanced, Business and Enterprise.
</Info>

You can set up an automation to forward conversations to your inbox. This way you will receive an email so a human can follow up the chat.

To make this happen, we need to tell the Agent when to handover the conversation, which data it needs to collect and we need to build an automation to make sure the data is forwarded to the email.

What you need:

1. Advanced/Business/Enterprise plan
2. Admin rights for API keys
3. Zapier paid plan
4. Access to email account

## 1. Set up Human handover

Start by setting up Human Handover in Watermelon. The Handover is needed so the Agent knows in which cases the Agent needs to forward conversations. The handover triggers the automation in Zapier which forwards the conversation to your email.

<Note>
  How does handover work?

  Agent collects details → customer types trigger → Human Handover fires → Zapier sends email.
</Note>

<Steps>
  <Step title="Open Human Handover in Watermelon">
    Go to Situations and go to Human Handover.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/handover-menu.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=b47d0bd7e455654fc0a75dd38a3dd614" alt="Handover Menu" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/handover-menu.png" />
    </Frame>
  </Step>

  <Step title="Allow Human Handover outside office hours">
    Decide if you want to forward conversations outside office hours. If you turn on the toggle, conversations outside business hours will also be forwarded to your email.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/handover-outside-business-hours.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=713e9892ed594ba56ed96887dd33f1ec" alt="Handover Outside Business Hours" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/handover-outside-business-hours.png" />
    </Frame>
  </Step>

  <Step title="Add instructions">
    To manage expectations for the end-user, you can add instructions for the Agent what it needs to say during/outside office hours. Example:

    > Your request has been submitted. Our team will reach out as soon as possible.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/handover-instructions.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=2cec128149c994435d0da133a2f9d865" alt="Handover Instructions" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/handover-instructions.png" />
    </Frame>

    <Warning>
      Be aware that after the Handover your Agent has left the Chat. You can include this information in the instructions above.
    </Warning>
  </Step>

  <Step title="Create Trigger">
    To technically trigger the handover, we need a code word. We call this code word a trigger. When a customer types this trigger, the message is automatically forwarded.

    Click **Create** to create a new Trigger and select **new** in the dropdown menu.

    Suggested trigger: **Submit request.**

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/handover-trigger.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=a4bc01059db7294b1edeef42a1a9c259" alt="Handover Trigger" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/handover-trigger.png" />
    </Frame>

    <Note>
      It's important to choose a trigger sentence which is not used in conversations often. Otherwise the automation might be triggered without all necessary data.
    </Note>
  </Step>
</Steps>

## 2. Write instruction

Now the Handover is set-up, you need to make sure the Agent collects all needed information, before forwarding the conversation.

<Steps>
  <Step title="Create new Instruction">
    In the Agent settings, go to **Instructions** and click **Create** to create a new instruction.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/instruction-handover.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=8a5bee3e375936d8ba6393bccf04bc4b" alt="Instruction Handover" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/instruction-handover.png" />
    </Frame>
  </Step>

  <Step title="Write instruction">
    Write an instruction where you explain the following to the Agent:

    1. In which case does the Agent Handover the conversation.
    2. Add a list of all items the Agent needs to collect before the handover.
    3. Lastly add the Handover trigger. This trigger should be the same combination of words you used in the set up of the Handover above.

       \
       Example:

    > When someone asks for an offer, you ask the following details from the customer:
    >
    > 1. Name
    > 2. Email address
    > 3. Phone number
    >
    >    When you received this information, you ask the person to write **Submit request**. This way, an employee can reach out.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/instruction-handover.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=8a5bee3e375936d8ba6393bccf04bc4b" alt="Instruction Handover" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/instruction-handover.png" />
    </Frame>
  </Step>
</Steps>

## 3. Create automation

Now everything is set up in Watermelon, we can create the automation in Zapier. This automation will make sure your chats will actually be forwared to your email.

<Steps>
  <Step title="Open Zapier in Apps">
    In Watermelon, go to **Apps** and open **Zapier**.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/zapier-integrations.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=82a944ee8514a8b18ca50ac9519d8a0e" alt="Zapier Integrations" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/zapier-integrations.png" />
    </Frame>
  </Step>

  <Step title="Select App and workflow">
    In the next screen, select the App you use for email. Also select the workflow: **hand over conversation agent in Watermelon and send email**. If this workflow does not pop up, select **Create from scratch.**

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/zapier-create-from-scratch.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=d20ba25d3c3485a40b0d812509cb59d5" alt="Zapier Create From Scratch" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/zapier-create-from-scratch.png" />
    </Frame>
  </Step>

  <Step title="Connect Watermelon to Zapier">
    When you click **use this workflow** or **Create from scratch**, Zapier will open in a new screen.

    It should show as the image below. Click **Select** to connect Watermelon to Zapier.

    <Frame>
      <img src="https://mintcdn.com/watermelon/m0SdOc4sit8TtPGk/images/automation-guides/forward-conversations-to-email/forward-conversations-email-connect.png?fit=max&auto=format&n=m0SdOc4sit8TtPGk&q=85&s=7246cdb7b8215e7d2914bb61c4bf20d3" alt="Forward Conversations Email Connect Pn" width="2888" height="1376" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-connect.png" />
    </Frame>
  </Step>

  <Step title="Add API Keys">
    A new screen will open where you need to add API keys.

    <Frame>
      <img src="https://mintcdn.com/watermelon/cm_xIakt0l-qRUnh/images/automation-guides/forward-conversations-to-email/forward-conversations-email-zapier-api-keys.png?fit=max&auto=format&n=cm_xIakt0l-qRUnh&q=85&s=1c572ce481aab90a07c99138026a42fb" alt="Forward Conversations Email Zapier Api Keys Pn" width="2878" height="1580" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-zapier-api-keys.png" />
    </Frame>
  </Step>

  <Step title="Create API Key">
    In Watermelon, go to API keys and click **Create** to create a new API key.

    Give the API Key a name and make sure to select **Read and write**. Read and write permissions are needed so the API can collect and use the correct details.

    Add the keys to the Zapier fields.

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/zapier-api-key.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=d56ffb734d3bfd08afc85e9ddf7abb83" alt="Zapier Api Key" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/zapier-api-key.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/watermelon/SSTykc9V_kfCQUMw/images/guides/automation-guides/process-leads-via-zapier/zapier-create-api-key.png?fit=max&auto=format&n=SSTykc9V_kfCQUMw&q=85&s=1a8426514b91a4032851e6c7754a4d0f" alt="Zapier Create Api Key" width="2938" height="1390" data-path="images/guides/automation-guides/process-leads-via-zapier/zapier-create-api-key.png" />
    </Frame>
  </Step>

  <Step title="Test connection">
    In Zapier, click on continue to test the connection with Watermelon.

    <Frame>
      <img src="https://mintcdn.com/watermelon/7pXm_JLplF3HXQry/images/automation-guides/forward-conversations-to-email/forward-conversations-email-api-key-test-connection.png?fit=max&auto=format&n=7pXm_JLplF3HXQry&q=85&s=1e24d00985750dcb3571b9c08d4933fd" alt="Forward Conversations Email Api Key Test Connection Pn" width="2900" height="1376" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-api-key-test-connection.png" />
    </Frame>

    <Warning>
      You need a conversation in your inbox to test this step. Follow these steps if no conversations are handed off:

      1. Open your Chat Widget
      2. Start a conversation
      3. Use the Trigger word you set up in step 1 of this article.
      4. After the conversation is handed off in Watermelon, click **Find new records** in Zapier.

         Your new conversation should show up.
    </Warning>
  </Step>

  <Step title="Add AI by Zapier">
    <Warning>
      AI by Zapier is a paid service, you can also skip this step and load the full message payload into the email.
    </Warning>

    Click on the plus button to add an extra step and select **AI by Zapier**.

    <Frame>
      <img src="https://mintcdn.com/watermelon/zofLCnI651Jn5MrV/images/automation-guides/forward-conversations-to-email/forward-conversations-email-extra-step.png?fit=max&auto=format&n=zofLCnI651Jn5MrV&q=85&s=3d99ffaf1a384513b81e010aa2fa3cab" alt="Forward Conversations Email Extra Step Pn" width="2928" height="1420" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-extra-step.png" />
    </Frame>
  </Step>

  <Step title="Set up AI by Zapier">
    1. In the **input field**, click on the Plus button and select **Message payload**.

    <Frame>
      <img src="https://mintcdn.com/watermelon/zofLCnI651Jn5MrV/images/automation-guides/forward-conversations-to-email/forward-conversations-email-input-field.png?fit=max&auto=format&n=zofLCnI651Jn5MrV&q=85&s=660d1a70e18e1a52ed6bb672b7f3fd0c" alt="Forward Conversations Email Input Field Pn" width="2926" height="1414" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-input-field.png" />
    </Frame>

    2. Add the following prompt:

       > Get the details from the Message payload

           <Frame>
             <img src="https://mintcdn.com/watermelon/kRl4V26COK4HR4O3/images/automation-guides/forward-conversations-to-email/forward-conversations-email-prompt.png?fit=max&auto=format&n=kRl4V26COK4HR4O3&q=85&s=556a1d904696ff5baf8b9c3164076594" alt="Forward Conversations Email Prompt Pn" width="2922" height="1406" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-prompt.png" />
           </Frame>
    3. At **Output fields**, click **add field**. Give the fields a name and select the field type. Repeat this for all desired data.

           <Frame>
             <img src="https://mintcdn.com/watermelon/kRl4V26COK4HR4O3/images/automation-guides/forward-conversations-to-email/forward-conversations-email-output-field.png?fit=max&auto=format&n=kRl4V26COK4HR4O3&q=85&s=bc0609958b23132a61d8c752292288e1" alt="Forward Conversations Email Output Field Pn" width="2924" height="1414" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-output-field.png" />
           </Frame>
    4. Click **Generate preview** to see the outcome of your prompt and click **Finish.**

           <Frame>
             <img src="https://mintcdn.com/watermelon/kRl4V26COK4HR4O3/images/automation-guides/forward-conversations-to-email/forward-conversations-email-preview.png?fit=max&auto=format&n=kRl4V26COK4HR4O3&q=85&s=25143479b53f54f85dac94cb1c8a235c" alt="Forward Conversations Email Preview Pn" width="2926" height="1420" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-preview.png" />
           </Frame>
  </Step>

  <Step title="Set up mail connection">
    Select your email provider. At **Action event,** click **Send email.**

    In account connect your email adress by logging in at your provider

    <Frame>
      <img src="https://mintcdn.com/watermelon/zofLCnI651Jn5MrV/images/automation-guides/forward-conversations-to-email/forward-conversations-email-connect-email.png?fit=max&auto=format&n=zofLCnI651Jn5MrV&q=85&s=20740e8ae0124aeb82bec07eb3714c21" alt="Forward Conversations Email Connect Email Pn" width="2930" height="1414" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-connect-email.png" />
    </Frame>
  </Step>

  <Step title="Configure email">
    Now you are going to configure your email settings.

    1. ****Add to/from addresses:****

       * In the **To field**, add the email address where the emails should be send to.
       * In the **From field**, add the email address of the sender. Best is to use an exsisting email address. Otherwise your emails might end up in your Spam folder.

           <Frame>
             <img src="https://mintcdn.com/watermelon/0ZxymsmfWKlmUqLD/images/automation-guides/forward-conversations-to-email/forward-conversations-email-to-from.png?fit=max&auto=format&n=0ZxymsmfWKlmUqLD&q=85&s=79fcbf9bf7975986c5c6c77ca83cebb4" alt="Forward Conversations Email To From Pn" width="2922" height="1366" data-path="images/automation-guides/forward-conversations-to-email/forward-conversations-email-to-from.png" />
           </Frame>
    2. Add **Subject** and **body**
       * For the **Subject,** choose a subject which makes clear to the receiving party what needs to be done. Example: *New chat via Watermelon*
       * In the **Body** field, write the email you want to receive.

         If you click the **plus** button, you can add the **Output fields** from AI by Zapier. Add the Message Payload to include the entire conversation.

         > Hi,
         >
         > A new chat came in via Watermelon. Please follow up the request.
         >
         > Name: \[Name]
         >
         > Email: \[emailaddress]
         >
         > Phonenumber: \[phone number]
         >
         > Chat conversation: \[message payload]
  </Step>

  <Step title="Test step">
    Click on **Continue** and test the email step.
  </Step>

  <Step title="Publish workflow">
    When the email is received correctly, you can **Publish** our workflow by clicking **Publish**.
  </Step>
</Steps>

Your automation is now completed. You can test your automation in the Chat Widget. The handover functionality and automation do not work in the **Playground**.
