# Send Template Emails from a Podio Item

To simplify the email process with **Workflow Automation**, add a few new fields to your Customer app and use templates to create and send email right from the **Podio** item.

## Podio Preparation

First off, changes need to happen in **Podio**:

1. Create a new **App** in your workspace and call it Templates, with:

   * a **Text** field (single line) for the **Title of the Template**
   * a **Text** field (multi line) for the **Email Body**
   * Optionally also add a **Text** field (single line) for a **Subject Line** for more control on your email.

     ![Temp Podio Prep](https://www.progress.com/podio/documentation/assets/1487ff20d90ca7733a31f441e40ba50d/temp-podio-prep1.png)

2. Add required fields to the **Customers App**.

   * Add a **Relationship** field for the **Email Template** and set it to the **Template APP** you just created.
   * Add a **Text** field (single line) for the Subject Line.
   * Add a **Text** field (multi line) for the Email Body.
   * Also, add a **Category** field with one button called **SEND** as this will be required to trigger the **Send Email** flow.

     ![Temp Podio Prep](https://www.progress.com/podio/documentation/assets/2ad36b5cfcc7cd7364ff6c6365b43f7e/temp-podio-prep1a.png)

## The Flows

Now that the **Podio Workspace** is set up, we can set up the flows required to create the template and send the email.

1. Create a new flow in the **Customer App** to Update **Email Template**

   * Trigger when an item is updated
   * Filter when the Email Template value has changed
   * Collector to Get Referenced Items from the Templates App.
   * Update this Customer item with the Email Subject and Email Body from the referenced item, using tokens

     ![Temp Flows](https://www.progress.com/podio/documentation/assets/26ec4bd86e4efcc119b809664f9cec98/temp-flow1.png)

2. Create a new flow in the **Customer App** to Update **Email Body**

   * Trigger when an item is updated
   * Filter when the **Category** field has changed and the **Category** field is equal to **Send**
   * Send an email to the **Email Address** token making sure that replies trigger another Flow.
   * Add a Comment to this item and insert the email body token.
   * Update this Customer item and remove the **Email Template**, **Email Body**, **Email Subject** and uncheck the **Send** box.

     ![Temp Flows](https://www.progress.com/podio/documentation/assets/90a420ec7726a5329ab28a51f40275ce/temp-flow1a.png)

3. Create a new flow in the **Customer App** to Update **Email Body**

   * Trigger when an email reply is received
   * Add a Comment to this item and insert the email body token.

     ![Temp Flows](https://www.progress.com/podio/documentation/assets/f1f7cfffcbb631b19b958f24779c5227/temp-flow1b.png)

## The Result

1. We are now ready to send email right from the Podio Item.

   * Open the Customer item to whom to send the email.

   * Add the Email Template you want to send to the client

   * Refresh the screen as the fields for Email Subject and Body have been populated

     ![Temp Result](https://www.progress.com/podio/documentation/assets/cb3c4615a4b8b404cb93c08a3bcddc1c/temp-result1.png)

   * Make any needed adjustments to the template before sending

   * Select the SEND category

     ![Temp Result](https://www.progress.com/podio/documentation/assets/929bc9d95173b54654ceea5ed1188013/temp-result1a.png)

   * This email has now been sent and has been added to the comments.

     ![Temp Result](https://www.progress.com/podio/documentation/assets/b476c01616e256a9558b98d1d4e30891/temp-result1b.png)

2. When the customer replies to the email, a new comment will appear on the item with this email. You will receive a notification since you're already following the item by default.

   ![Temp Result](https://www.progress.com/podio/documentation/assets/c661b920383947adc0881230664a57c5/temp-result1c.png)
