# How to insert coupon codes in automation emails?

In each automation workflow, there is a coupon block designed to generate dynamic coupons.&#x20;

{% hint style="success" %}
A **dynamic coupon** is a unique, automatically generated coupon code in the coupon block that is created within an automation workflow.
{% endhint %}

These dynamic coupons can be seamlessly included in your automated emails to provide personalized offers to customers.

For example, in the Abandoned Cart Recovery workflow, we configure the coupon block to generate and send dynamic coupons to the customers via automated email.

<figure><img src="/files/9pzHO51KwBImNgWBfTej" alt=""><figcaption><p>Workflow coupon settings</p></figcaption></figure>

> 1. Click on the ‘Coupon’ block
> 2. Select the Coupon type
> 3. Enter the coupon value and set up expiry (Optional: You can enter a minimum order value if you would like to set up a minimum order value required for using the coupon)
> 4. Save.

Now, you have successfully configured the coupon block.

## Inserting Coupon in email block

There are two ways to insert the coupon code,

* Using the coupon code from the Coupon configuration block
* Creating the new coupon code in the email editor

### Using the coupon code from the coupon configuration block:

In the email template, click on the coupon block **`{{retainful_dynamic_coupon}}`**, and you'll find the coupon settings on the right side. In the coupon settings, click on the first option that says '**Use the coupon code generated by the coupon step**.

<figure><img src="/files/EuCFx3LyCuT8ocXVqFLP" alt=""><figcaption><p>Confguring Coupon block</p></figcaption></figure>

By doing this, you ensure that the coupon code generated in the coupon block will be sent to customers through this abandoned cart recovery email.

### Creating the new coupon code in the email editor

* **Click on the Coupon Block**: Locate and click on the coupon block that says **`{{retainful_dynamic_coupon}}`** in the email template.
* **Select the "Create a Coupon Rule" Option**: On the right-hand side, under *Coupon Settings*, choose the second option labeled **"Create a Coupon Rule"**.
* **Configure the Coupon Conditions**:
  * Choose the coupon type (Percentage, Fixed amount, Free shipping).
  * Set the value (e.g., 10%).
  * Optionally, specify the validity period (e.g., 6 days).
  * Add additional conditions like minimum order value, sale item exclusions, or product inclusions/exclusions.
* **Save Your Changes**: Once you’ve set the coupon conditions, click on **Save Coupon Settings** to apply the changes.

<figure><img src="/files/0V1pUOGwoWW9F0bATGB3" alt=""><figcaption><p>Coupon conditions</p></figcaption></figure>

This will ensure that your dynamic coupon is properly configured and ready to be used in your automation workflow.

{% hint style="info" %}
**Need More Help in setting up Retainful?** <br>

We’re here to make things easier for you!<br>

* **Email Us:** Reach out anytime at [<mark style="color:orange;">support@retainful.com</mark>](mailto:support@retainful.com)<mark style="color:orange;">.</mark>
* **Schedule a Call:** Still stuck or need a hands-on walkthrough?

\
&#x20;[<mark style="color:orange;">**Book a quick session with our support team**</mark>](https://zcal.co/retainful/onboarding), and we’ll guide you step-by-step.
{% endhint %}


---

# 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://help.retainful.com/how-tos/how-to-insert-coupon-codes-in-automation-emails.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.
